linux-info.eclass: Ignore check_extra_config on non-Linux
authorMichał Górny <mgorny@gentoo.org>
Thu, 8 Mar 2018 16:21:41 +0000 (17:21 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 9 Jul 2018 16:54:47 +0000 (18:54 +0200)
Make the check_extra_config and pkg_setup calls no-op on non-Linux
systems. Those systems don't have a Linux kernel, so they obviously
can't satisfy the requirements. This currently results in a lot of
useless warnings about missing Linux kernel sources on FreeBSD. We could
make it conditional per-package but there is really no point in adding
a lot of conditionals everywhere if this eclass can't ever work
on non-Linux.

eclass/linux-info.eclass

index 5795219a880b4cfce786c995a73592ac7a6791bd..51be89dbcf3439a08f944df4cb9360b892d9770d 100644 (file)
@@ -110,6 +110,8 @@ inherit toolchain-funcs versionator
 
 EXPORT_FUNCTIONS pkg_setup
 
+IUSE="kernel_linux"
+
 # Overwritable environment Var's
 # ---------------------------------------
 KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
@@ -688,8 +690,10 @@ check_modules_supported() {
 # @FUNCTION: check_extra_config
 # @DESCRIPTION:
 # It checks the kernel config options specified by CONFIG_CHECK. It dies only when a required config option (i.e.
-# the prefix ~ is not used) doesn't satisfy the directive.
+# the prefix ~ is not used) doesn't satisfy the directive. Ignored on non-Linux systems.
 check_extra_config() {
+       use kernel_linux || return
+
        local config negate die error reworkmodulenames
        local soft_errors_count=0 hard_errors_count=0 config_required=0
        # store the value of the QA check, because otherwise we won't catch usages
@@ -902,6 +906,8 @@ check_zlibinflate() {
 # Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
 # to support the options specified in CONFIG_CHECK (if not null)
 linux-info_pkg_setup() {
+       use kernel_linux || return
+
        linux-info_get_any_version
 
        if kernel_is 2 4; then