Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 09 Jul 2018 16:55:01
Message-Id: 1531155287.51562449412d635b03cb71132315f0045dd33819.mgorny@gentoo
1 commit: 51562449412d635b03cb71132315f0045dd33819
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 8 16:21:41 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 9 16:54:47 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51562449
7
8 linux-info.eclass: Ignore check_extra_config on non-Linux
9
10 Make the check_extra_config and pkg_setup calls no-op on non-Linux
11 systems. Those systems don't have a Linux kernel, so they obviously
12 can't satisfy the requirements. This currently results in a lot of
13 useless warnings about missing Linux kernel sources on FreeBSD. We could
14 make it conditional per-package but there is really no point in adding
15 a lot of conditionals everywhere if this eclass can't ever work
16 on non-Linux.
17
18 eclass/linux-info.eclass | 8 +++++++-
19 1 file changed, 7 insertions(+), 1 deletion(-)
20
21 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
22 index 5795219a880..51be89dbcf3 100644
23 --- a/eclass/linux-info.eclass
24 +++ b/eclass/linux-info.eclass
25 @@ -110,6 +110,8 @@ inherit toolchain-funcs versionator
26
27 EXPORT_FUNCTIONS pkg_setup
28
29 +IUSE="kernel_linux"
30 +
31 # Overwritable environment Var's
32 # ---------------------------------------
33 KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
34 @@ -688,8 +690,10 @@ check_modules_supported() {
35 # @FUNCTION: check_extra_config
36 # @DESCRIPTION:
37 # It checks the kernel config options specified by CONFIG_CHECK. It dies only when a required config option (i.e.
38 -# the prefix ~ is not used) doesn't satisfy the directive.
39 +# the prefix ~ is not used) doesn't satisfy the directive. Ignored on non-Linux systems.
40 check_extra_config() {
41 + use kernel_linux || return
42 +
43 local config negate die error reworkmodulenames
44 local soft_errors_count=0 hard_errors_count=0 config_required=0
45 # store the value of the QA check, because otherwise we won't catch usages
46 @@ -902,6 +906,8 @@ check_zlibinflate() {
47 # Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
48 # to support the options specified in CONFIG_CHECK (if not null)
49 linux-info_pkg_setup() {
50 + use kernel_linux || return
51 +
52 linux-info_get_any_version
53
54 if kernel_is 2 4; then