From: Zac Medico Date: Mon, 17 Oct 2011 05:20:10 +0000 (-0700) Subject: portdbapi.aux_get: remove redunant EAPI code X-Git-Tag: v2.2.0_alpha68~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ddb7d3068f53025e064e5f23bcfaf068401b9bd;p=portage.git portdbapi.aux_get: remove redunant EAPI code This code only needs to exist in _metadata_callback. --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a0b7d7e1f..6ad7a6b37 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -405,8 +405,11 @@ class portdbapi(dbapi): eapi = "0" metadata["EAPI"] = eapi if not eapi_is_supported(eapi): - for k in set(metadata).difference(("_mtime_", "_eclasses_")): - metadata[k] = "" + keys = set(metadata) + keys.discard('_eclasses_') + keys.discard('_mtime_') + keys.discard('_%s_' % chf) + metadata.update((k, '') for k in keys) metadata["EAPI"] = "-" + eapi.lstrip("-") if cache is not None: @@ -455,6 +458,7 @@ class portdbapi(dbapi): eapi = metadata.get('EAPI', '').strip() if not eapi: eapi = '0' + metadata['EAPI'] = eapi if eapi[:1] == '-' and eapi_is_supported(eapi[1:]): continue if auxdb.validate_entry(metadata, ebuild_hash, eclass_db): @@ -544,21 +548,14 @@ class portdbapi(dbapi): mydata = proc.metadata - # do we have a origin repository name for the current package mydata["repository"] = self.repositories.get_name_for_location(mylocation) - mydata["INHERITED"] = ' '.join(mydata.get("_eclasses_", [])) mydata["_mtime_"] = ebuild_hash.mtime - eapi = mydata.get("EAPI") if not eapi: eapi = "0" mydata["EAPI"] = eapi - if not eapi_is_supported(eapi): - keys = set(mydata) - keys.discard("_eclasses_") - keys.discard("_mtime_") - mydata.update((k, '') for k in keys) - mydata["EAPI"] = "-" + eapi.lstrip("-") + if eapi_is_supported(eapi): + mydata["INHERITED"] = " ".join(mydata.get("_eclasses_", [])) #finally, we look at our internal cache entry and return the requested data. returnme = [mydata.get(x, "") for x in mylist]