Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11548 - main/trunk/pym/portage/cache
Date: Thu, 25 Sep 2008 23:29:41
Message-Id: E1Kj0HC-00040C-DU@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-09-25 23:29:37 +0000 (Thu, 25 Sep 2008)
3 New Revision: 11548
4
5 Modified:
6 main/trunk/pym/portage/cache/util.py
7 Log:
8 Fix mirror_cache() so it won't silently swallow a KeyError if _mtime_ or
9 _eclass_ happens to be missing from the cache data for some reason.
10
11
12 Modified: main/trunk/pym/portage/cache/util.py
13 ===================================================================
14 --- main/trunk/pym/portage/cache/util.py 2008-09-25 23:13:52 UTC (rev 11547)
15 +++ main/trunk/pym/portage/cache/util.py 2008-09-25 23:29:37 UTC (rev 11548)
16 @@ -39,12 +39,16 @@
17 trg = None
18 try:
19 trg = trg_cache[x]
20 - if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \
21 - eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \
22 - set(trg["_eclasses_"]) == set(entry["_eclasses_"]):
23 - write_it = False
24 - except (cache_errors.CacheError, KeyError):
25 + except KeyError:
26 pass
27 + else:
28 + try:
29 + if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \
30 + eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \
31 + set(trg["_eclasses_"]) == set(entry["_eclasses_"]):
32 + write_it = False
33 + except cache_errors.CacheError:
34 + pass
35
36 if trg and not write_it:
37 """ We don't want to skip the write unless we're really sure that