summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-20 22:09:59 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-20 22:09:59 +0000
commit448a409c030cc2aaf99cc686e76d62b5739e5df8 (patch)
treecdec9c42e859255d2507c49f5bbd5847cb8381ea
parentc0d4e2f94f74305e479e4fb4879aeda58f8ad046 (diff)
downloadportage-448a409c030cc2aaf99cc686e76d62b5739e5df8.tar.gz
portage-448a409c030cc2aaf99cc686e76d62b5739e5df8.tar.bz2
portage-448a409c030cc2aaf99cc686e76d62b5739e5df8.zip
More intelligently handle CacheCorruption errors in the writable cache.
svn path=/main/trunk/; revision=5338
-rw-r--r--pym/cache/metadata_overlay.py4
1 files changed, 4 insertions, 0 deletions
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)