commit:     81f5aea4dedb55fdc18723a93ee2ba5d39b3053b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 29 01:42:11 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 19:13:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81f5aea4

autotools.eclass: drop ROOT=/ in has_version call

Noticed when doing a read-through of the eclass (which is how I noticed
c8e74a7dfe477dea008548553141f083c5d03782 too).

Forcing ROOT=/ is, at best, going to confuse matters, and at worst,
do entirely the wrong thing. In EAPI 5 and 6, we had --host-root (which
we use in the eclass), and in EAPI 7+, we have -b/-d (which we use in
the eclass too). The ROOT= setting was there for pre-EAPI 5 times.

The aforementioned toggles (--host-root and then later on, -b/-d) are the
correct methods to specify (B)ROOT for has_version. Using one of those
with ROOT= have undefined behaviour, so drop it.

Bug: https://bugs.gentoo.org/312687
Thanks-to: James Le Cuirot <chewi <AT> gentoo.org>
Thanks-to: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/autotools.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index e6658e361318..b8eeb55fd8f2 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -523,7 +523,7 @@ autotools_env_setup() {
                                        hv_args="-b"
                                        ;;
                        esac
-                       ROOT=/ has_version ${hv_args} 
"=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
+                       has_version ${hv_args} "=sys-devel/automake-${pv}*" && 
export WANT_AUTOMAKE="${pv}" && break
                done
                [[ ${WANT_AUTOMAKE} == "latest" ]] && \
                        die "Cannot find the latest automake! Tried 
${_LATEST_AUTOMAKE[*]}"

Reply via email to