summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-19 23:19:19 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-19 23:19:19 +0000
commit5a4361ca3561df37293081c7a8b675d4d6219af2 (patch)
treec857d925a836ee4f45875f33ab73b0d59875402a /pym/portage.py
parentb5d9d7f51273cb945d729352e7a24dc1fd33fd97 (diff)
downloadportage-5a4361ca3561df37293081c7a8b675d4d6219af2.tar.gz
portage-5a4361ca3561df37293081c7a8b675d4d6219af2.tar.bz2
portage-5a4361ca3561df37293081c7a8b675d4d6219af2.zip
Validate and normalize target_root earlier in the config constructor.
(trunk r10369) svn path=/main/branches/2.1.2/; revision=10370
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage.py b/pym/portage.py
index ba79b2d43..cfc998999 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1438,6 +1438,12 @@ class config:
if target_root is None:
target_root = "/"
+ target_root = normalize_path(os.path.abspath(
+ target_root)).rstrip(os.path.sep) + os.path.sep
+
+ portage_util.ensure_dirs(target_root)
+ check_var_directory("ROOT", target_root)
+
# The expand_map is used for variable substitution
# in getconfig() calls, and the getconfig() calls
# update expand_map with the value of each variable
@@ -1551,12 +1557,6 @@ class config:
cfg.pop(blacklisted, None)
del blacklisted, cfg
- target_root = normalize_path(os.path.abspath(
- target_root)).rstrip(os.path.sep) + os.path.sep
-
- portage_util.ensure_dirs(target_root)
- check_var_directory("ROOT", target_root)
-
self["PORTAGE_CONFIGROOT"] = config_root
self.backup_changes("PORTAGE_CONFIGROOT")
self["ROOT"] = target_root