1 |
commit: 102220e1f71341e9bc85236074813f191bb389a4 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 2 21:55:56 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 3 17:38:15 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=102220e1 |
7 |
|
8 |
phase-helpers.sh: has/best_version -b in any phase (bug 665038) |
9 |
|
10 |
Since BROOT is only defined in src_* phases, make has/best_version -b |
11 |
use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is defined |
12 |
in all phases. This makes has/best_version -b in EAPI 7 behave exactly |
13 |
the same as --host-root behaves in EAPI 6, allowing python ebuilds to |
14 |
call python_setup in any ebuild phase. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/665038 |
17 |
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org> |
18 |
|
19 |
bin/phase-helpers.sh | 7 ++++++- |
20 |
1 file changed, 6 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
23 |
index 5c9f957e9..ba3f27930 100644 |
24 |
--- a/bin/phase-helpers.sh |
25 |
+++ b/bin/phase-helpers.sh |
26 |
@@ -916,7 +916,12 @@ ___best_version_and_has_version_common() { |
27 |
case ${root_arg} in |
28 |
-r) root=${ROOT%/}/${EPREFIX#/} ;; |
29 |
-d) root=${ESYSROOT} ;; |
30 |
- -b) root=${BROOT:-/} ;; |
31 |
+ -b) |
32 |
+ # Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent |
33 |
+ # to BROOT, except BROOT is only defined in src_* phases. |
34 |
+ root=/${PORTAGE_OVERRIDE_EPREFIX#/} |
35 |
+ cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}") |
36 |
+ ;; |
37 |
esac |
38 |
else |
39 |
case ${root_arg} in |