Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: base-system@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH] autotools.eclass: drop ROOT=/ in has_version call
Date: Fri, 29 Apr 2022 01:46:11
Message-Id: 20220429014546.1889254-1-sam@gentoo.org
1 Noticed when doing a read-through of the eclass (which is how I noticed
2 c8e74a7dfe477dea008548553141f083c5d03782 too).
3
4 Forcing ROOT=/ is, at best, going to confuse matters, and at worst,
5 do entirely the wrong thing. In EAPI 5 and 6, we had --host-root (which
6 we use in the eclass), and in EAPI 7+, we have -b/-d (which we use in
7 the eclass too). The ROOT= setting was there for pre-EAPI 5 times.
8
9 The aforementioned toggles (--host-root and then later on, -b/-d) are the
10 correct methods to specify (B)ROOT for has_version. Using one of those
11 with ROOT= have undefined behaviour, so drop it.
12
13 Bug: https://bugs.gentoo.org/312687
14 Thanks-to: James Le Cuirot <chewi@g.o>
15 Thanks-to: Ulrich Müller <ulm@g.o>
16 Signed-off-by: Sam James <sam@g.o>
17 ---
18 eclass/autotools.eclass | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
22 index e6658e361318..b8eeb55fd8f2 100644
23 --- a/eclass/autotools.eclass
24 +++ b/eclass/autotools.eclass
25 @@ -523,7 +523,7 @@ autotools_env_setup() {
26 hv_args="-b"
27 ;;
28 esac
29 - ROOT=/ has_version ${hv_args} "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
30 + has_version ${hv_args} "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
31 done
32 [[ ${WANT_AUTOMAKE} == "latest" ]] && \
33 die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}"
34 --
35 2.35.1