From 80d2c435a58d88cfe71f37378bffae35e072408f Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 2 Jan 2023 17:21:05 +0000 Subject: 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 We did the same with gcc-config. This aligns the start of these scripts. Signed-off-by: James Le Cuirot Signed-off-by: Sam James --- src/binutils-config | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/binutils-config b/src/binutils-config index 4219f93..37ea77c 100755 --- a/src/binutils-config +++ b/src/binutils-config @@ -1,28 +1,25 @@ #!/usr/bin/env bash -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Format of /etc/env.d/binutils/: # config-TARGET: CURRENT=version for TARGET # TARGET-VER: has a TARGET and VER variable -EPREFIX="@GENTOO_EPREFIX@" -if [[ ${EPREFIX} == "@"GENTOO_EPREFIX"@" ]] ; then - EPREFIX="" -fi - : ${ROOT:=/} [[ ${ROOT} != */ ]] && ROOT="${ROOT}/" [[ ${ROOT} != /* ]] && ROOT="${PWD%/}/${ROOT}" - +BROOT="@GENTOO_EPREFIX@" +[[ ${BROOT} == @*@ ]] && BROOT="" +: ${EPREFIX="${BROOT}"} EROOT="${ROOT%/}${EPREFIX}/" -cd "${EPREFIX}/" +cd "${BROOT}/" trap ":" INT QUIT TSTP argv0=${0##*/} -FUNCTIONS_SH="${EPREFIX}/lib/gentoo/functions.sh" +FUNCTIONS_SH="${BROOT}/lib/gentoo/functions.sh" source ${FUNCTIONS_SH} || { echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2 exit 1 -- cgit v1.2.3-65-gdbad