• [gentoo-dev] [PATCH] autotools.eclass: drop ROOT=/ in has_version call

    From Sam James@21:1/5 to All on Fri Apr 29 03:50:01 2022
    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@gentoo.org>
    Thanks-to: Ulrich Müller <ulm@gentoo.org>
    Signed-off-by: Sam James <sam@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[*]}"
    --
    2.35.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)