aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2023-12-02 22:53:49 +0000
committerSam James <sam@gentoo.org>2023-12-04 06:45:45 +0000
commit632fea4f4aa4bdca63bf6d8db266b09a6954e313 (patch)
tree8a508c5ba1bd36bfa51d355737bf6462622685c4 /bin
parentemerge: avoid spamming too much info about unused binpkgs, redux (diff)
downloadportage-632fea4f4aa4bdca63bf6d8db266b09a6954e313.tar.gz
portage-632fea4f4aa4bdca63bf6d8db266b09a6954e313.tar.bz2
portage-632fea4f4aa4bdca63bf6d8db266b09a6954e313.zip
Set SYSROOT for has/best_version so that they work when IPC is disabled
This issue broke cross-compiling. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1198 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin')
-rw-r--r--bin/phase-helpers.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ec634e536..45a1639c4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -907,7 +907,11 @@ __eapi8_src_prepare() {
___best_version_and_has_version_common() {
local atom root root_arg
- local -a cmd=()
+
+ # If ROOT is set to / below then SYSROOT cannot point elsewhere. Even if
+ # ROOT is untouched, setting SYSROOT=/ for this command will always work.
+ local -a cmd=(env SYSROOT=/)
+
case $1 in
--host-root|-r|-d|-b)
root_arg=$1
@@ -932,7 +936,7 @@ ___best_version_and_has_version_common() {
# Since portageq requires the root argument be consistent
# with EPREFIX, ensure consistency here (bug #655414).
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
- cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
+ cmd+=(EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
else
root=/
fi ;;
@@ -948,7 +952,7 @@ ___best_version_and_has_version_common() {
# Use /${PORTAGE_OVERRIDE_EPREFIX#/} to support older
# EAPIs, as it is equivalent to BROOT.
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
- cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
+ cmd+=(EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
;;
esac
else