aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-23 18:59:45 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-05-23 18:59:45 (GMT)
commit1b367f9121b7c9cdceab644539b329c501e539c2 (patch)
tree56cd07b9a85c7c3cb752a8221142ce059230cc24
parentProfile parent repo: references for bug #414961. (diff)
downloadportage-1b367f9121b7c9cdceab644539b329c501e539c2.zip
portage-1b367f9121b7c9cdceab644539b329c501e539c2.tar.gz
portage-1b367f9121b7c9cdceab644539b329c501e539c2.tar.bz2
validate_entry: handle KeyError for bug #417253
This error is triggered by corrupt cache entries.
-rw-r--r--pym/portage/cache/template.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py
index 0af6c20..0ab6e0a 100644
--- a/pym/portage/cache/template.py
+++ b/pym/portage/cache/template.py
@@ -194,8 +194,13 @@ class database(object):
def validate_entry(self, entry, ebuild_hash, eclass_db):
hash_key = '_%s_' % self.validation_chf
- if entry[hash_key] != getattr(ebuild_hash, self.validation_chf):
+ try:
+ entry_hash = entry[hash_key]
+ except KeyError:
return False
+ else:
+ if entry_hash != getattr(ebuild_hash, self.validation_chf):
+ return False
update = eclass_db.validate_and_rewrite_cache(entry['_eclasses_'], self.validation_chf,
self.store_eclass_paths)
if update is None: