Fix mirror_cache() so it won't silently swallow a KeyError if _mtime_ or
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Sep 2008 23:29:37 +0000 (23:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Sep 2008 23:29:37 +0000 (23:29 -0000)
_eclass_ happens to be missing from the cache data for some reason.

svn path=/main/trunk/; revision=11548

pym/portage/cache/util.py

index f256be76ffa3ab6998e14228f8e55b08ad0ca4f9..253ada0098b11082ece9d962e98015fddb963236 100644 (file)
@@ -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