1 |
commit: a0ac6e6727abec8d2482c95b1e84d8df24d78619 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 1 18:14:07 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 1 18:15:47 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0ac6e67 |
7 |
|
8 |
phase-helpers.sh: fix best/has_version -b for cross-prefix |
9 |
|
10 |
Fixes: 43b6be7423aa ("phase-helpers.sh: Implement -r|-d|-b options for best/has_version") |
11 |
|
12 |
bin/phase-helpers.sh | 2 +- |
13 |
pym/portage/tests/emerge/test_simple.py | 12 ++++++++++++ |
14 |
2 files changed, 13 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
17 |
index 59c19cf67..8b16d7d31 100644 |
18 |
--- a/bin/phase-helpers.sh |
19 |
+++ b/bin/phase-helpers.sh |
20 |
@@ -912,7 +912,7 @@ ___best_version_and_has_version_common() { |
21 |
case ${root_arg} in |
22 |
-r) root=${EROOT} ;; |
23 |
-d) root=${ESYSROOT} ;; |
24 |
- -b) root=${BROOT:-/} ;; |
25 |
+ -b) root=${BROOT:-/${PORTAGE_OVERRIDE_EPREFIX#/}} ;; |
26 |
esac |
27 |
else |
28 |
case ${root_arg} in |
29 |
|
30 |
diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py |
31 |
index 17dcd548d..495e22297 100644 |
32 |
--- a/pym/portage/tests/emerge/test_simple.py |
33 |
+++ b/pym/portage/tests/emerge/test_simple.py |
34 |
@@ -119,11 +119,13 @@ pkg_preinst() { |
35 |
"EAPI" : "7_pre1", |
36 |
"KEYWORDS": "~x86", |
37 |
"RDEPEND": "dev-libs/D[flag]", |
38 |
+ "MISC_CONTENT": install_something, |
39 |
}, |
40 |
"dev-libs/D-1": { |
41 |
"EAPI" : "7_pre1", |
42 |
"KEYWORDS": "~x86", |
43 |
"IUSE" : "flag", |
44 |
+ "MISC_CONTENT": install_something, |
45 |
}, |
46 |
"virtual/foo-0": { |
47 |
"EAPI" : "5", |
48 |
@@ -326,6 +328,16 @@ pkg_preinst() { |
49 |
portageq_cmd + ("match", eroot, "dev-libs/D[flag]"), |
50 |
|
51 |
# Test cross-prefix usage, including chpathtool for binpkgs. |
52 |
+ # EAPI 7 |
53 |
+ ({"EPREFIX" : cross_prefix},) + \ |
54 |
+ emerge_cmd + ("dev-libs/C",), |
55 |
+ ({"EPREFIX" : cross_prefix},) + \ |
56 |
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/C"), |
57 |
+ ({"EPREFIX" : cross_prefix},) + \ |
58 |
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/D"), |
59 |
+ ({"ROOT": cross_root},) + emerge_cmd + ("dev-libs/D",), |
60 |
+ portageq_cmd + ("has_version", cross_eroot, "dev-libs/D"), |
61 |
+ # EAPI 5 |
62 |
({"EPREFIX" : cross_prefix},) + \ |
63 |
emerge_cmd + ("--usepkgonly", "dev-libs/A"), |
64 |
({"EPREFIX" : cross_prefix},) + \ |