Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/cache/
Date: Sat, 29 Oct 2011 23:10:32
Message-Id: 2c1ea6faef52448d0836f070997d5d20f0b53103.zmedico@gentoo
1 commit: 2c1ea6faef52448d0836f070997d5d20f0b53103
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 29 23:10:13 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 23:10:13 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2c1ea6fa
7
8 cache/template.__getitem__: filter INHERITED
9
10 Never return INHERITED, since portdbapi.aux_get() will generate it
11 automatically from _eclasses_, and we want to omit it in comparisons
12 between cache entries like those that egencache uses to avoid redundant
13 writes (see commit 0e120da008c9d0d41c9372c81145c6e153028a6d).
14
15 ---
16 pym/portage/cache/metadata.py | 1 -
17 pym/portage/cache/template.py | 5 +++++
18 2 files changed, 5 insertions(+), 1 deletions(-)
19
20 diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py
21 index 07ec20e..9d2c3a5 100644
22 --- a/pym/portage/cache/metadata.py
23 +++ b/pym/portage/cache/metadata.py
24 @@ -72,7 +72,6 @@ class database(flat_hash.database):
25 except KeyError as e:
26 # INHERITED contains a non-existent eclass.
27 raise cache_errors.CacheCorruption(cpv, e)
28 - del d["INHERITED"]
29 else:
30 d["_eclasses_"] = {}
31 elif isinstance(d["_eclasses_"], basestring):
32
33 diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py
34 index 515ba02..0af6c20 100644
35 --- a/pym/portage/cache/template.py
36 +++ b/pym/portage/cache/template.py
37 @@ -47,6 +47,11 @@ class database(object):
38 self.validation_chf, paths=self.store_eclass_paths)
39 elif "_eclasses_" not in d:
40 d["_eclasses_"] = {}
41 + # Never return INHERITED, since portdbapi.aux_get() will
42 + # generate it automatically from _eclasses_, and we want
43 + # to omit it in comparisons between cache entries like
44 + # those that egencache uses to avoid redundant writes.
45 + d.pop("INHERITED", None)
46 mtime = d.get('_mtime_')
47 if mtime is None:
48 raise cache_errors.CacheCorruption(cpv,