public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH] LocationsManager: map empty root var to / (bug 663904)
@ 2018-08-17 20:08 99% Zac Medico
  0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2018-08-17 20:08 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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
---
 lib/portage/package/ebuild/_config/LocationsManager.py | 5 ++---
 1 file 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..b8a4ccdd0 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.path.sep) + os.path.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
-- 
2.16.4



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2018-08-17 20:08 99% [gentoo-portage-dev] [PATCH] LocationsManager: map empty root var to / (bug 663904) Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox