Gentoo Archives: gentoo-dev

From: Mike Pagano <mpagano@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] Support Makefiles that set variables to a non-static value
Date: Wed, 01 Sep 2021 18:44:20
Message-Id: f02ae9ab-a5fa-540f-ba8d-033ad6a684a0@gentoo.org
1 Previously, the kernel Makefile had to define version variables
2 as static string literals to be read.
3 This change will allow varibles defined as non-static values
4 to be read.
5
6 Bug: https://bugs.gentoo.org/490328
7
8 Signed-off-by: Mike Pagano <mpagano@g.o>
9 ---
10 eclass/linux-info.eclass | 13 +++++--------
11 1 file changed, 5 insertions(+), 8 deletions(-)
12
13 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
14 index 8edd17c31..0b6df1bf5 100644
15 --- a/eclass/linux-info.eclass
16 +++ b/eclass/linux-info.eclass
17 @@ -539,14 +539,11 @@ get_version() {
18
19 # And contrary to existing functions I feel we shouldn't trust the
20 # directory name to find version information as this seems insane.
21 - # So we parse ${KERNEL_MAKEFILE}. We should be able to trust that
22 - # the Makefile is simple enough to use the noexec extract function.
23 - # This has been true for every release thus far, and it's faster
24 - # than using make to evaluate the Makefile every time.
25 - KV_MAJOR=$(getfilevar_noexec VERSION "${KERNEL_MAKEFILE}")
26 - KV_MINOR=$(getfilevar_noexec PATCHLEVEL "${KERNEL_MAKEFILE}")
27 - KV_PATCH=$(getfilevar_noexec SUBLEVEL "${KERNEL_MAKEFILE}")
28 - KV_EXTRA=$(getfilevar_noexec EXTRAVERSION "${KERNEL_MAKEFILE}")
29 + # So we parse ${KERNEL_MAKEFILE}.
30 + KV_MAJOR=$(getfilevar VERSION "${KERNEL_MAKEFILE}")
31 + KV_MINOR=$(getfilevar PATCHLEVEL "${KERNEL_MAKEFILE}")
32 + KV_PATCH=$(getfilevar SUBLEVEL "${KERNEL_MAKEFILE}")
33 + KV_EXTRA=$(getfilevar EXTRAVERSION "${KERNEL_MAKEFILE}")
34
35 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
36 then
37 --
38 2.32.0

Replies