commit:     9fbedc2a1aa8b71daaafc4598f69d312914c191d
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 26 10:09:17 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 28 19:11:58 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=9fbedc2a

Allow EPREFIX to be overridden for manipulating prefixed ROOT

This use case was totally broken. We need to hardcode BROOT instead, as
we don't want to source /lib/gentoo/functions.sh from ROOT.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 gcc-config | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc-config b/gcc-config
index 08002fd..c5d907c 100755
--- a/gcc-config
+++ b/gcc-config
@@ -9,8 +9,9 @@
 : ${ROOT:=/}
 [[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
 [[ ${ROOT} != /* ]] && ROOT="${PWD%/}/${ROOT}"
-EPREFIX="@GENTOO_EPREFIX@"
-[[ ${EPREFIX} == @*@ ]] && EPREFIX=""
+BROOT="@GENTOO_EPREFIX@"
+[[ ${BROOT} == @*@ ]] && BROOT=""
+: ${EPREFIX="${BROOT}"}
 EROOT="${ROOT%/}${EPREFIX}/"
 
 cd /
@@ -18,7 +19,7 @@ cd /
 trap ":" INT QUIT TSTP
 
 argv0=${0##*/}
-functions_script="${EPREFIX}/lib/gentoo/functions.sh"
+functions_script="${BROOT}/lib/gentoo/functions.sh"
 source "${functions_script}" || {
        echo "${argv0}: Could not source ${functions_script}!" 1>&2
        exit 1

Reply via email to