1 |
commit: 680c4144051d0b72a0066de5dbec2f20e8d0d71b |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 3 16:47:25 2011 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 3 16:47:25 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=680c4144 |
7 |
|
8 |
portageq: fix root/eroot handling for Prefix |
9 |
|
10 |
__PORTAGE_TEST_EPREFIX will almost always be empty, hence the code |
11 |
believes that no offset prefix is in use. In Prefix, this is always on |
12 |
the contrary, so when not set, use the hardwired EPREFIX from |
13 |
portage.const. This avoids double prefixes seen for the portageq |
14 |
functions, and hence funcs like has_version always return false. |
15 |
|
16 |
--- |
17 |
bin/portageq | 4 ++++ |
18 |
1 files changed, 4 insertions(+), 0 deletions(-) |
19 |
|
20 |
diff --git a/bin/portageq b/bin/portageq |
21 |
index fe980a2..27a77a8 100755 |
22 |
--- a/bin/portageq |
23 |
+++ b/bin/portageq |
24 |
@@ -843,6 +843,10 @@ def main(): |
25 |
sys.stderr.flush() |
26 |
sys.exit(os.EX_USAGE) |
27 |
eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX") |
28 |
+ # PREFIX LOCAL: make sure we fall back to our hardwired EPREFIX |
29 |
+ if not eprefix: |
30 |
+ eprefix = portage.const.EPREFIX |
31 |
+ # END PREFIX LOCAL |
32 |
eroot = portage.util.normalize_path(sys.argv[2]) |
33 |
if eprefix: |
34 |
root = eroot[:1-len(eprefix)] |