From 33d05b373895d70d432f83f02650a200295836e8 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 13 Oct 2006 17:31:50 +0000 Subject: [PATCH] Strip off prefix from the tail of ROOT when portage is called from within ebuilds or eclasses to avoid a double prefix. svn path=/main/branches/prefix/; revision=4669 --- pym/portage.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pym/portage.py b/pym/portage.py index 115002f2a..2d2ca0b28 100644 --- 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 != "/": -- 2.26.2