LocationsManager: fix SYSROOT normalization to handle empty SYSROOT
This issue was exposed when building portage-2.3.34 with USE="epydoc"
enabled, since epydoc triggers instantiation of portage.settings.
The empty SYSROOT change for bug 654600 (in commit
1b5110557d1dd725f7c12bbed4b7ceaaec29f2a3) triggered incorrect
normalization behavior here.
Fixes: a41dacf7926c ("Export SYSROOT and ESYSROOT in ebuild env in EAPI 7")
diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
index b57443b..f7d7209 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
@@ -69,7 +69,7 @@
if self.sysroot is None:
self.sysroot = "/"
else:
- self.sysroot = normalize_path(os.path.abspath(self.sysroot)).rstrip(os.sep) + os.sep
+ self.sysroot = normalize_path(os.path.abspath(self.sysroot or os.sep)).rstrip(os.sep) + os.sep
self.esysroot = self.sysroot.rstrip(os.sep) + self.eprefix + os.sep