summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-23 00:11:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-23 00:11:25 +0000
commitbc55ce47217542610f9a4ccb50d7e8ca38841178 (patch)
tree1c1baee3b28a95da2314fe6bc49abf9ff8779b69
parentf2002b88d9b17c8c1ce2ced85de29d330230f1de (diff)
downloadportage-bc55ce47217542610f9a4ccb50d7e8ca38841178.tar.gz
portage-bc55ce47217542610f9a4ccb50d7e8ca38841178.tar.bz2
portage-bc55ce47217542610f9a4ccb50d7e8ca38841178.zip
When filtering the backupenv in create_trees(), be more
selective and ensure that special variables that come from the config constructor are preserved. (trunk r8609) svn path=/main/branches/2.1.2/; revision=8610
-rw-r--r--pym/portage.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 7964e1cdd..1dce3a1d0 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -9272,7 +9272,21 @@ def create_trees(config_root=None, target_root=None, trees=None):
# with ROOT != "/", so we wipe out the "backupenv" for the
# config that is associated with ROOT == "/" and regenerate
# it's incrementals.
- settings.configdict["backupenv"].clear()
+
+ # Preserve backupenv values that are initialized in the config
+ # constructor. Also, preserve XARGS since it is set by the
+ # portage.data module.
+ backupenv_whitelist = set(["FEATURES", "PORTAGE_BIN_PATH",
+ "PORTAGE_CONFIGROOT", "PORTAGE_DEPCACHEDIR",
+ "PORTAGE_GID", "PORTAGE_INST_GID", "PORTAGE_INST_UID",
+ "PORTAGE_PYM_PATH", "PORTDIR_OVERLAY", "ROOT", "USE_ORDER",
+ "XARGS"])
+ backupenv = settings.configdict["backupenv"]
+ for k, v in os.environ.iteritems():
+ if k in backupenv_whitelist:
+ continue
+ if v == backupenv.get(k):
+ del backupenv[k]
settings.regenerate()
settings.lock()
settings.validate()