diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-25 04:46:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-25 04:46:23 +0000 |
commit | 8d274910f26b05d62851fa79d0eb144a04ec1c17 (patch) | |
tree | 18555925933abb9d1ed8224e538def8375f0c5c2 | |
parent | 094e4d97d67f8e39aa17ea39bad04daa2cd26350 (diff) | |
download | portage-8d274910f26b05d62851fa79d0eb144a04ec1c17.tar.gz portage-8d274910f26b05d62851fa79d0eb144a04ec1c17.tar.bz2 portage-8d274910f26b05d62851fa79d0eb144a04ec1c17.zip |
Inside portdbapi._metadata_callback(), preserve _eclasses_ when the EAPI is
unsupported since the eclass timestamps might be needed in order to decide
that the cache entry should be regenerated. Also, make sure that all metadata
returned from portdbapi.aux_get() is returned as empty strings when the
EAPI is unsupported.
svn path=/main/trunk/; revision=12330
-rw-r--r-- | pym/portage/dbapi/porttree.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 19010bc62..77e6ae494 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -296,17 +296,6 @@ class portdbapi(dbapi): i = metadata.iteritems() metadata = dict(i) - if "EAPI" not in metadata or not metadata["EAPI"].strip(): - metadata["EAPI"] = "0" - - if not eapi_is_supported(metadata["EAPI"]): - # if newer version, wipe everything and negate eapi - eapi = metadata["EAPI"] - metadata = {} - for x in self._known_keys: - metadata.setdefault(x, "") - metadata["EAPI"] = "-" + eapi - if metadata.get("INHERITED", False): metadata["_eclasses_"] = \ self.eclassdb.get_eclass_data(metadata["INHERITED"].split()) @@ -315,6 +304,16 @@ class portdbapi(dbapi): metadata.pop("INHERITED", None) metadata["_mtime_"] = mtime + + eapi = metadata.get("EAPI") + if not eapi or not eapi.strip(): + eapi = "0" + metadata["EAPI"] = eapi + if not eapi_is_supported(eapi): + for k in set(metadata).difference(("_mtime_", "_eclasses_")): + metadata[k] = "" + metadata["EAPI"] = "-" + eapi.lstrip("-") + self.auxdb[repo_path][cpv] = metadata def _pull_valid_cache(self, cpv, ebuild_path, repo_path): @@ -425,15 +424,21 @@ class portdbapi(dbapi): else: mydata["_eclasses_"] = {} - if not mydata.setdefault("EAPI", "0"): - mydata["EAPI"] = "0" - # do we have a origin repository name for the current package mydata["repository"] = self._repository_map.get( os.path.sep.join(myebuild.split(os.path.sep)[:-3]), "") mydata["INHERITED"] = ' '.join(mydata.get("_eclasses_", [])) - mydata["_mtime_"] = st.st_mtime + mydata["_mtime_"] = long(st.st_mtime) + + eapi = mydata.get("EAPI") + if not eapi: + eapi = "0" + mydata["EAPI"] = eapi + if not eapi_is_supported(eapi): + for k in set(mydata).difference(("_mtime_", "_eclasses_")): + mydata[k] = "" + mydata["EAPI"] = "-" + eapi.lstrip("-") #finally, we look at our internal cache entry and return the requested data. returnme = [mydata.get(x, "") for x in mylist] |