From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0FDDB15800F for ; Tue, 3 Jan 2023 01:02:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 541DDE08C8; Tue, 3 Jan 2023 01:02:50 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3B215E08C8 for ; Tue, 3 Jan 2023 01:02:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6A9E4340B29 for ; Tue, 3 Jan 2023 01:02:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C6BAB72B for ; Tue, 3 Jan 2023 01:02:47 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1672707695.80d2c435a58d88cfe71f37378bffae35e072408f.sam@gentoo> Subject: [gentoo-commits] proj/binutils-config:master commit in: src/ X-VCS-Repository: proj/binutils-config X-VCS-Files: src/binutils-config X-VCS-Directories: src/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 80d2c435a58d88cfe71f37378bffae35e072408f X-VCS-Branch: master Date: Tue, 3 Jan 2023 01:02:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0018329d-d96b-4294-98bc-767b03dc79bb X-Archives-Hash: 5e05ce455fbb75e73952dcea367bb573 commit: 80d2c435a58d88cfe71f37378bffae35e072408f Author: James Le Cuirot gentoo org> AuthorDate: Mon Jan 2 17:21:05 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jan 3 01:01:35 2023 +0000 URL: https://gitweb.gentoo.org/proj/binutils-config.git/commit/?id=80d2c435 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 gentoo.org> Signed-off-by: Sam James gentoo.org> 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