Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 4/8] linux-info.eclass: Move get_version to require_configured_kernel
Date: Thu, 08 Mar 2018 17:07:46
Message-Id: 20180308170548.5782-5-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/8] linux-info.eclass: cleanup & better non-Linux support by "Michał Górny"
1 All require_configured_kernel calls in this eclass are followed
2 by a get_version call. Since even calling it proactively wouldn't hurt,
3 move it to require_configured_kernel. This saves us from having
4 to manually implement error handling for it everywhere.
5 ---
6 eclass/linux-info.eclass | 4 +---
7 1 file changed, 1 insertion(+), 3 deletions(-)
8
9 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
10 index 37a60b430646..177cb7fafcde 100644
11 --- a/eclass/linux-info.eclass
12 +++ b/eclass/linux-info.eclass
13 @@ -295,6 +295,7 @@ require_configured_kernel() {
14 qeerror "it points to the necessary object directory so that it might find .config."
15 die "Kernel not configured; no .config found in ${KV_OUT_DIR}"
16 fi
17 + get_version
18 }
19
20 # @FUNCTION: linux_chkconfig_present
21 @@ -646,7 +647,6 @@ linux-info_get_any_version() {
22 check_kernel_built() {
23 # if we haven't determined the version yet, we need to
24 require_configured_kernel
25 - get_version
26
27 local versionh_path
28 if kernel_is -ge 3 7; then
29 @@ -676,7 +676,6 @@ check_kernel_built() {
30 check_modules_supported() {
31 # if we haven't determined the version yet, we need too.
32 require_configured_kernel
33 - get_version
34
35 if ! linux_chkconfig_builtin "MODULES"; then
36 eerror "These sources do not support loading external modules."
37 @@ -831,7 +830,6 @@ check_extra_config() {
38 check_zlibinflate() {
39 # if we haven't determined the version yet, we need to
40 require_configured_kernel
41 - get_version
42
43 # although I restructured this code - I really really really dont support it!
44
45 --
46 2.16.2