From: Zac Medico Date: Wed, 20 Dec 2006 22:09:59 +0000 (-0000) Subject: More intelligently handle CacheCorruption errors in the writable cache. X-Git-Tag: v2.1.2~258 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=448a409c030cc2aaf99cc686e76d62b5739e5df8;p=portage.git More intelligently handle CacheCorruption errors in the writable cache. svn path=/main/trunk/; revision=5338 --- diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py index 9320b0938..c4d18c173 100644 --- a/pym/cache/metadata_overlay.py +++ b/pym/cache/metadata_overlay.py @@ -6,6 +6,7 @@ import time if not hasattr(__builtins__, "set"): from sets import Set as set from cache import template +from cache.cache_errors import CacheCorruption from cache.flat_hash import database as db_rw from cache.metadata import database as db_ro @@ -26,6 +27,9 @@ class database(template.database): value = self.db_rw[cpv] except KeyError: return self.db_ro[cpv] # raises a KeyError when necessary + except CacheCorruption: + del self.db_rw[cpv] + return self.db_ro[cpv] # raises a KeyError when necessary if self._is_whiteout(value): if self._is_whiteout_valid(cpv, value): raise KeyError(cpv)