diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-23 00:08:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-23 00:08:00 +0000 |
commit | 094832c9dbc5b29d34af7ce1e6f36c7a3e861033 (patch) | |
tree | 60ad4ff2ce1bd5dd1d7ced845e09280d1e1bf021 | |
parent | 0d3e95391689e75564c33127e17594f71e992bd6 (diff) | |
download | portage-094832c9dbc5b29d34af7ce1e6f36c7a3e861033.tar.gz portage-094832c9dbc5b29d34af7ce1e6f36c7a3e861033.tar.bz2 portage-094832c9dbc5b29d34af7ce1e6f36c7a3e861033.zip |
When filtering the backupenv in create_trees(), be more
selective and ensure that special variables that come from
the config constructor are preserved.
svn path=/main/trunk/; revision=8609
-rw-r--r-- | pym/portage/__init__.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 0146d8431..e3f2dd2c6 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5770,7 +5770,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() |