Inside config.setcpv(), don't clear out self.configdict['pkg'] entirely
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 07:02:59 +0000 (07:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 07:02:59 +0000 (07:02 -0000)
since some values need to be reused sometimes. (trunk r13226)

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

pym/portage/__init__.py

index 2ce6472aa4f0e83670da8536e6804b83e8a3e2e2..673ad29030a1b3c4bef776c71dc99aa99cca194e 100644 (file)
@@ -2092,16 +2092,23 @@ class config(object):
                env_configdict = self.configdict["env"]
                pkg_configdict = self.configdict["pkg"]
                previous_iuse = pkg_configdict.get("IUSE")
-               pkg_configdict.clear()
+
+               aux_keys = [k for k in auxdbkeys \
+                       if not k.startswith("UNUSED_")]
+               aux_keys.append("repository")
+
+               # Discard any existing metadata from the previous package, but
+               # preserve things like USE_EXPAND values and PORTAGE_USE which
+               # might be reused.
+               for k in aux_keys:
+                       pkg_configdict.pop(k, None)
+
                pkg_configdict["CATEGORY"] = cat
                pkg_configdict["PF"] = pf
                if mydb:
                        if not hasattr(mydb, "aux_get"):
                                pkg_configdict.update(mydb)
                        else:
-                               aux_keys = [k for k in auxdbkeys \
-                                       if not k.startswith("UNUSED_")]
-                               aux_keys.append("repository")
                                for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
                                        pkg_configdict[k] = v
                        repository = pkg_configdict.pop("repository", None)