diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-27 06:56:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-27 06:56:23 +0000 |
commit | eadae837278f20c4fbda9f9ff29704228cfd7aa6 (patch) | |
tree | 99d3f5008b333457fca29e67b08183ac8e960174 | |
parent | bcfb87e519ccc11d8da6a6566aa4efbe92699a31 (diff) | |
download | portage-eadae837278f20c4fbda9f9ff29704228cfd7aa6.tar.gz portage-eadae837278f20c4fbda9f9ff29704228cfd7aa6.tar.bz2 portage-eadae837278f20c4fbda9f9ff29704228cfd7aa6.zip |
Inside config.setcpv(), don't clear out self.configdict['pkg'] entirely
since some values need to be reused sometimes.
svn path=/main/trunk/; revision=13226
-rw-r--r-- | pym/portage/__init__.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 7630c2ff1..ed07bca12 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2102,16 +2102,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) |