Exclude 'backupenv' from config.configlist and lookuplist since it doesn't
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:31:09 +0000 (07:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:31:09 +0000 (07:31 -0000)
make size to have it in there when configdict['env'] already serves that
purpose. This allows values to be temporarily removed from configdict['env']
and have them not appear in the environment until reset() is called to restore
those values from the backupenv. (trunk r13415)

svn path=/main/branches/2.1.6/; revision=13555

pym/portage/__init__.py

index 5d049990be8d003820734e1dea1175b88e6c22a6..0f0727bfa39adaf0e9d77238b0779627387c6671 100644 (file)
@@ -1257,19 +1257,19 @@ class config(object):
                        self.mycpv    = copy.deepcopy(clone.mycpv)
                        self._setcpv_args_hash = copy.deepcopy(clone._setcpv_args_hash)
 
-                       self.configlist = copy.deepcopy(clone.configlist)
+                       self.configdict = copy.deepcopy(clone.configdict)
+                       self.configlist = [
+                               self.configdict['env.d'],
+                               self.configdict['pkginternal'],
+                               self.configdict['globals'],
+                               self.configdict['defaults'],
+                               self.configdict['conf'],
+                               self.configdict['pkg'],
+                               self.configdict['auto'],
+                               self.configdict['env'],
+                       ]
                        self.lookuplist = self.configlist[:]
                        self.lookuplist.reverse()
-                       self.configdict = {
-                               "env.d":     self.configlist[0],
-                               "pkginternal": self.configlist[1],
-                               "globals":     self.configlist[2],
-                               "defaults":    self.configlist[3],
-                               "conf":        self.configlist[4],
-                               "pkg":         self.configlist[5],
-                               "auto":        self.configlist[6],
-                               "backupenv":   self.configlist[7],
-                               "env":         self.configlist[8] }
                        self._use_expand_dict = copy.deepcopy(clone._use_expand_dict)
                        self.profiles = copy.deepcopy(clone.profiles)
                        self.backupenv  = self.configdict["backupenv"]
@@ -1579,8 +1579,7 @@ class config(object):
                        self.configlist.append({})
                        self.configdict["auto"]=self.configlist[-1]
 
-                       self.configlist.append(self.backupenv) # XXX Why though?
-                       self.configdict["backupenv"]=self.configlist[-1]
+                       self.configdict["backupenv"] = self.backupenv
 
                        # Don't allow the user to override certain variables in the env
                        for k in profile_only_variables: