Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 02 Sep 2021 11:03:23
Message-Id: 1630580388.d1ea596f034285cd044006b107a60902ea059793.mpagano@gentoo
1 commit: d1ea596f034285cd044006b107a60902ea059793
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 2 10:58:49 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 2 10:59:48 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1ea596f
7
8 linux-info.eclass: Support Makefiles that set vars to a non-static value
9
10 Previously, the Makefile had to define version variables
11 be a string literal.
12 This change will support both methods.
13
14 Closes: https://bugs.gentoo.org/490328
15
16 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
17
18 eclass/linux-info.eclass | 13 +++++--------
19 1 file changed, 5 insertions(+), 8 deletions(-)
20
21 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
22 index 8edd17c317d..0b6df1bf591 100644
23 --- a/eclass/linux-info.eclass
24 +++ b/eclass/linux-info.eclass
25 @@ -539,14 +539,11 @@ get_version() {
26
27 # And contrary to existing functions I feel we shouldn't trust the
28 # directory name to find version information as this seems insane.
29 - # So we parse ${KERNEL_MAKEFILE}. We should be able to trust that
30 - # the Makefile is simple enough to use the noexec extract function.
31 - # This has been true for every release thus far, and it's faster
32 - # than using make to evaluate the Makefile every time.
33 - KV_MAJOR=$(getfilevar_noexec VERSION "${KERNEL_MAKEFILE}")
34 - KV_MINOR=$(getfilevar_noexec PATCHLEVEL "${KERNEL_MAKEFILE}")
35 - KV_PATCH=$(getfilevar_noexec SUBLEVEL "${KERNEL_MAKEFILE}")
36 - KV_EXTRA=$(getfilevar_noexec EXTRAVERSION "${KERNEL_MAKEFILE}")
37 + # So we parse ${KERNEL_MAKEFILE}.
38 + KV_MAJOR=$(getfilevar VERSION "${KERNEL_MAKEFILE}")
39 + KV_MINOR=$(getfilevar PATCHLEVEL "${KERNEL_MAKEFILE}")
40 + KV_PATCH=$(getfilevar SUBLEVEL "${KERNEL_MAKEFILE}")
41 + KV_EXTRA=$(getfilevar EXTRAVERSION "${KERNEL_MAKEFILE}")
42
43 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
44 then