From: Zac Medico Date: Thu, 25 Sep 2008 23:29:37 +0000 (-0000) Subject: Fix mirror_cache() so it won't silently swallow a KeyError if _mtime_ or X-Git-Tag: v2.2_rc10~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6dc9e2a9b1f4043a2c4972c5599f7a61b1f04f3f;p=portage.git Fix mirror_cache() so it won't silently swallow a KeyError if _mtime_ or _eclass_ happens to be missing from the cache data for some reason. svn path=/main/trunk/; revision=11548 --- diff --git a/pym/portage/cache/util.py b/pym/portage/cache/util.py index f256be76f..253ada009 100644 --- a/pym/portage/cache/util.py +++ b/pym/portage/cache/util.py @@ -39,12 +39,16 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, trg = None try: trg = trg_cache[x] - if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \ - eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \ - set(trg["_eclasses_"]) == set(entry["_eclasses_"]): - write_it = False - except (cache_errors.CacheError, KeyError): + except KeyError: pass + else: + try: + if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \ + eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \ + set(trg["_eclasses_"]) == set(entry["_eclasses_"]): + write_it = False + except cache_errors.CacheError: + pass if trg and not write_it: """ We don't want to skip the write unless we're really sure that