Normalize EPREFIX more.
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Jun 2013 22:23:32 +0000 (15:23 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Jun 2013 22:23:32 +0000 (15:23 -0700)
pym/portage/const.py
pym/portage/package/ebuild/_config/LocationsManager.py

index 5e960d9687758640162a2fdbbb5773d2525f25ed..087c0e78f4c638348a49e29372e7c7faa4b435e5 100644 (file)
@@ -164,6 +164,8 @@ if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
        EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
        if EPREFIX:
                EPREFIX = os.path.normpath(EPREFIX)
+               if EPREFIX == os.sep:
+                       EPREFIX = ""
 
 VCS_DIRS = ("CVS", "RCS", "SCCS", ".bzr", ".git", ".hg", ".svn")
 
index e328441a7fce0b4d8ab1eefdfc310d2757a75d14..80b6a70c636ecbb963d8b6a6f385a7bfca49e72c 100644 (file)
@@ -1,6 +1,8 @@
 # Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from __future__ import unicode_literals
+
 __all__ = (
        'LocationsManager',
 )
@@ -47,6 +49,10 @@ class LocationsManager(object):
 
                if self.eprefix is None:
                        self.eprefix = portage.const.EPREFIX
+               elif self.eprefix:
+                       self.eprefix = normalize_path(self.eprefix)
+                       if self.eprefix == os.sep:
+                               self.eprefix = ""
 
                if self.config_root is None:
                        self.config_root = portage.const.EPREFIX + os.sep