From 6dc9e2a9b1f4043a2c4972c5599f7a61b1f04f3f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 25 Sep 2008 23:29:37 +0000 Subject: [PATCH] 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 --- pym/portage/cache/util.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 -- 2.26.2