In create_trees(), when isolating the environment of the ROOT=/ config,
authorZac Medico <zmedico@gentoo.org>
Sat, 1 Dec 2007 08:38:31 +0000 (08:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 1 Dec 2007 08:38:31 +0000 (08:38 -0000)
use it's env.d keys as a blacklist to make env.d override the calling
environment.

svn path=/main/trunk/; revision=8785

pym/portage/__init__.py

index 204170038b7735a377057dfa0ca63bc42763d1b3..1c2488e331db17f6734580a524821d4cf6b59a1c 100644 (file)
@@ -6043,11 +6043,13 @@ def create_trees(config_root=None, target_root=None, trees=None):
 
                backupenv_whitelist = settings._environ_whitelist
                backupenv = settings.configdict["backupenv"]
+               env_d = settings.configdict["env.d"]
                for k, v in os.environ.iteritems():
                        if k in backupenv_whitelist:
                                continue
-                       if v == backupenv.get(k):
-                               del backupenv[k]
+                       if k in env_d or \
+                               v == backupenv.get(k):
+                               backupenv.pop(k, None)
                settings.regenerate()
                settings.lock()
                settings.validate()