summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-19 23:19:00 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-19 23:19:00 +0000
commit8142d9cc696c9620b6e7241c6e3800f893fa6026 (patch)
tree985d20e886f9a579f13225afec45e7ee8babdf37 /pym/portage
parentf445747b5d6f8f05efec0f6c3cd8e8c32292c6c2 (diff)
downloadportage-8142d9cc696c9620b6e7241c6e3800f893fa6026.tar.gz
portage-8142d9cc696c9620b6e7241c6e3800f893fa6026.tar.bz2
portage-8142d9cc696c9620b6e7241c6e3800f893fa6026.zip
Validate and normalize target_root earlier in the config constructor.
svn path=/main/trunk/; revision=10369
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index c8902b9bb..e0d99e6e8 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1278,6 +1278,12 @@ class config(object):
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
@@ -1391,12 +1397,6 @@ class config(object):
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