Exclude "env" from use in variable substitution since we want to avoid
authorZac Medico <zmedico@gentoo.org>
Mon, 19 May 2008 20:29:48 +0000 (20:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 19 May 2008 20:29:48 +0000 (20:29 -0000)
any interaction with the calling environment that might lead to
unexpected results.

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

pym/portage/__init__.py

index b02bc5160b44006436d06eb84f5097689e998ea6..c8902b9bb2d844ca1c57b39a5d5eab58e0814900 100644 (file)
@@ -1282,14 +1282,17 @@ class config(object):
                        # in getconfig() calls, and the getconfig() calls
                        # update expand_map with the value of each variable
                        # assignment that occurs. Variable substitution occurs
-                       # in the following order:
+                       # in the following order, which corresponds to the
+                       # order of appearance in self.lookuplist:
                        #
                        #   * env.d
-                       #   * env
                        #   * make.globals
                        #   * make.defaults
                        #   * make.conf
                        #
+                       # Notably absent is "env", since we want to avoid any
+                       # interaction with the calling environment that might
+                       # lead to unexpected results.
                        expand_map = {}
 
                        env_d = getconfig(os.path.join(target_root, "etc", "profile.env"),
@@ -1301,7 +1304,6 @@ class config(object):
 
                        # backupenv is used for calculating incremental variables.
                        self.backupenv = os.environ.copy()
-                       expand_map.update(self.backupenv)
 
                        # make.globals should not be relative to config_root
                        # because it only contains constants.