summaryrefslogtreecommitdiffstats
path: root/pym/portage/cache
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-29 16:10:13 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-29 16:10:13 -0700
commit2c1ea6faef52448d0836f070997d5d20f0b53103 (patch)
tree7572942aead5b8d685746030cca1256d89ef915f /pym/portage/cache
parentfea1962b7e8df9a8568b009a8f52b3c8ade67043 (diff)
downloadportage-2c1ea6faef52448d0836f070997d5d20f0b53103.tar.gz
portage-2c1ea6faef52448d0836f070997d5d20f0b53103.tar.bz2
portage-2c1ea6faef52448d0836f070997d5d20f0b53103.zip
cache/template.__getitem__: filter INHERITED
Never return INHERITED, since portdbapi.aux_get() will generate it automatically from _eclasses_, and we want to omit it in comparisons between cache entries like those that egencache uses to avoid redundant writes (see commit 0e120da008c9d0d41c9372c81145c6e153028a6d).
Diffstat (limited to 'pym/portage/cache')
-rw-r--r--pym/portage/cache/metadata.py1
-rw-r--r--pym/portage/cache/template.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py
index 07ec20ebc..9d2c3a5d7 100644
--- a/pym/portage/cache/metadata.py
+++ b/pym/portage/cache/metadata.py
@@ -72,7 +72,6 @@ class database(flat_hash.database):
except KeyError as e:
# INHERITED contains a non-existent eclass.
raise cache_errors.CacheCorruption(cpv, e)
- del d["INHERITED"]
else:
d["_eclasses_"] = {}
elif isinstance(d["_eclasses_"], basestring):
diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py
index 515ba022b..0af6c20ca 100644
--- a/pym/portage/cache/template.py
+++ b/pym/portage/cache/template.py
@@ -47,6 +47,11 @@ class database(object):
self.validation_chf, paths=self.store_eclass_paths)
elif "_eclasses_" not in d:
d["_eclasses_"] = {}
+ # Never return INHERITED, since portdbapi.aux_get() will
+ # generate it automatically from _eclasses_, and we want
+ # to omit it in comparisons between cache entries like
+ # those that egencache uses to avoid redundant writes.
+ d.pop("INHERITED", None)
mtime = d.get('_mtime_')
if mtime is None:
raise cache_errors.CacheCorruption(cpv,