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

svn path=/main/branches/2.1.2/; revision=8786

pym/portage.py

index 75ba2aa14a651563ff9a2aeb89c0d55e9d5f2121..77b7d0baf646a15983e1022bdafb1f8ac660f04e 100644 (file)
@@ -9674,11 +9674,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()