In config.setcpv(), move the code that makes sure "pkg" values override "env"
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 05:29:54 +0000 (05:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 05:29:54 +0000 (05:29 -0000)
values _after_ the reset() call.

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

pym/portage/__init__.py

index 43a3dfad8f14a6cac33a84b210039c5f326e463c..c849227d95ba9676edf9f54fef22b057fd52737c 100644 (file)
@@ -2215,7 +2215,6 @@ class config(object):
                cpv_slot = self.mycpv
                pkginternaluse = ""
                iuse = ""
-               env_configdict = self.configdict["env"]
                pkg_configdict = self.configdict["pkg"]
                previous_iuse = pkg_configdict.get("IUSE")
 
@@ -2241,9 +2240,6 @@ class config(object):
                        repository = pkg_configdict.pop("repository", None)
                        if repository is not None:
                                pkg_configdict["PORTAGE_REPO_NAME"] = repository
-                       for k in pkg_configdict:
-                               if k != "USE":
-                                       env_configdict.pop(k, None)
                        slot = pkg_configdict["SLOT"]
                        iuse = pkg_configdict["IUSE"]
                        if pkg is None:
@@ -2313,6 +2309,14 @@ class config(object):
                if has_changed:
                        self.reset(keeping_pkg=1,use_cache=use_cache)
 
+               # Ensure that "pkg" values are always preferred over "env" values.
+               # This must occur _after_ the above reset() call, since reset()
+               # copies values from self.backupenv.
+               env_configdict = self.configdict['env']
+               for k in pkg_configdict:
+                       if k != 'USE':
+                               env_configdict.pop(k, None)
+
                env_configdict.addLazySingleton('ACCEPT_LICENSE',
                        self._lazy_accept_license(self))