aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-08-17 12:59:08 -0700
committerZac Medico <zmedico@gentoo.org>2018-08-17 15:40:09 -0700
commit836c5ba9352ef1fa2c14d29e8876533a9db72465 (patch)
tree548ac7234cde55f2b3fa36b043701f2913f3f595
parentconfig: default features USE for conditional RESTRICT (bug 663848) (diff)
downloadportage-836c5ba9352ef1fa2c14d29e8876533a9db72465.tar.gz
portage-836c5ba9352ef1fa2c14d29e8876533a9db72465.tar.bz2
portage-836c5ba9352ef1fa2c14d29e8876533a9db72465.zip
LocationsManager: map empty root var to / (bug 663904)
When ROOT or PORTAGE_CONFIGROOT is entirely empty, map the value to / since otherwise is becomes the current working directory which gives undesirable results. Bug: https://bugs.gentoo.org/663904
-rw-r--r--lib/portage/package/ebuild/_config/LocationsManager.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/portage/package/ebuild/_config/LocationsManager.py b/lib/portage/package/ebuild/_config/LocationsManager.py
index f7d7209ff..75320258f 100644
--- a/lib/portage/package/ebuild/_config/LocationsManager.py
+++ b/lib/portage/package/ebuild/_config/LocationsManager.py
@@ -60,7 +60,7 @@ class LocationsManager(object):
self.config_root = portage.const.EPREFIX + os.sep
self.config_root = normalize_path(os.path.abspath(
- self.config_root)).rstrip(os.path.sep) + os.path.sep
+ self.config_root or os.sep)).rstrip(os.sep) + os.sep
self._check_var_directory("PORTAGE_CONFIGROOT", self.config_root)
self.abs_user_config = os.path.join(self.config_root, USER_CONFIG_PATH)
@@ -304,8 +304,7 @@ class LocationsManager(object):
self.target_root = root_overwrite
if not self.target_root.strip():
self.target_root = None
- if self.target_root is None:
- self.target_root = "/"
+ self.target_root = self.target_root or os.sep
self.target_root = normalize_path(os.path.abspath(
self.target_root)).rstrip(os.path.sep) + os.path.sep