From: Fabian Groffen Date: Fri, 13 Oct 2006 17:31:50 +0000 (-0000) Subject: Strip off prefix from the tail of ROOT when portage is called from X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=33d05b373895d70d432f83f02650a200295836e8;p=portage.git 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 --- 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 != "/":