aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-09-02 14:55:56 -0700
committerZac Medico <zmedico@gentoo.org>2018-09-03 10:38:15 -0700
commit102220e1f71341e9bc85236074813f191bb389a4 (patch)
tree343a38f1a2215af4e77ea65738aac86bb043cabc
parentman/emerge.1: fix "the the" typo (bug 664272) (diff)
downloadportage-102220e1f71341e9bc85236074813f191bb389a4.tar.gz
portage-102220e1f71341e9bc85236074813f191bb389a4.tar.bz2
portage-102220e1f71341e9bc85236074813f191bb389a4.zip
phase-helpers.sh: has/best_version -b in any phase (bug 665038)
Since BROOT is only defined in src_* phases, make has/best_version -b use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is defined in all phases. This makes has/best_version -b in EAPI 7 behave exactly the same as --host-root behaves in EAPI 6, allowing python ebuilds to call python_setup in any ebuild phase. Bug: https://bugs.gentoo.org/665038 Reviewed-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--bin/phase-helpers.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5c9f957e9..ba3f27930 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -916,7 +916,12 @@ ___best_version_and_has_version_common() {
case ${root_arg} in
-r) root=${ROOT%/}/${EPREFIX#/} ;;
-d) root=${ESYSROOT} ;;
- -b) root=${BROOT:-/} ;;
+ -b)
+ # Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
+ # to BROOT, except BROOT is only defined in src_* phases.
+ root=/${PORTAGE_OVERRIDE_EPREFIX#/}
+ cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
+ ;;
esac
else
case ${root_arg} in