projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b5255c
)
Strip off prefix from the tail of ROOT when portage is called from
author
Fabian Groffen
<grobian@gentoo.org>
Fri, 13 Oct 2006 17:31:50 +0000
(17:31 -0000)
committer
Fabian Groffen
<grobian@gentoo.org>
Fri, 13 Oct 2006 17:31:50 +0000
(17:31 -0000)
within ebuilds or eclasses to avoid a double prefix.
svn path=/main/branches/prefix/; revision=4669
pym/portage.py
patch
|
blob
|
history
diff --git
a/pym/portage.py
b/pym/portage.py
index 115002f2adcf865099e73d2e6dac6596f99b704d..2d2ca0b2880ec04f356121f3779a39c04cd3c235 100644
(file)
--- a/
pym/portage.py
+++ b/
pym/portage.py
@@
-6479,6
+6479,13
@@
if os.environ.has_key("ROOT"):
root="/"
elif root[-1]!="/":
root=root+"/"
+ # strip off prefix from the tail of the string, this happens when
+ # portage is called from within ebuilds or eclasses
+ prefix=portage_const.EPREFIX
+ if prefix[-1]!="/":
+ prefix=prefix+"/"
+ if root.endswith(prefix):
+ root=root[0:-len(prefix)]+"/"
else:
root="/"
if root != "/":