summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-06 17:25:41 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-06 17:25:41 -0700
commitac6ee1217d2309cbc2ab4af893f57fc5b76eaeb2 (patch)
tree548ee8341317be041530ad36f0d36c3d6375ef64
parent0395c698afd27f5ae5ea2dbc20c61979097bc1dd (diff)
downloadportage-ac6ee1217d2309cbc2ab4af893f57fc5b76eaeb2.tar.gz
portage-ac6ee1217d2309cbc2ab4af893f57fc5b76eaeb2.tar.bz2
portage-ac6ee1217d2309cbc2ab4af893f57fc5b76eaeb2.zip
Bug #331429 - Fix breakage in package.properties and package.license
handling due to behavior of ExtendedAtomDict.get(). We need to use setdefault() when updating ExtendedAtomDict like this.
-rw-r--r--pym/portage/package/ebuild/config.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index ba3e91c97..ff9894d8e 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -868,12 +868,8 @@ class config(object):
else:
self.configdict["conf"]["ACCEPT_LICENSE"] = " ".join(v)
for k, v in licdict.items():
- cp = k.cp
- cp_dict = self._plicensedict.get(cp)
- if not cp_dict:
- cp_dict = {}
- self._plicensedict[cp] = cp_dict
- cp_dict[k] = self.expandLicenseTokens(v)
+ self._plicensedict.setdefault(k.cp, {})[k] = \
+ self.expandLicenseTokens(v)
#package.properties
propdict = grabdict_package(os.path.join(
@@ -885,12 +881,7 @@ class config(object):
else:
self.configdict["conf"]["ACCEPT_PROPERTIES"] = " ".join(v)
for k, v in propdict.items():
- cp = k.cp
- cp_dict = self._ppropertiesdict.get(cp)
- if not cp_dict:
- cp_dict = {}
- self._ppropertiesdict[cp] = cp_dict
- cp_dict[k] = v
+ self._ppropertiesdict.setdefault(k.cp, {})[k] = v
self._local_repo_configs = {}
self._local_repo_conf_path = \