From: Zac Medico Date: Wed, 23 May 2012 18:59:45 +0000 (-0700) Subject: validate_entry: handle KeyError for bug #417253 X-Git-Tag: v2.2.0_alpha108~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1b367f9121b7c9cdceab644539b329c501e539c2;p=portage.git validate_entry: handle KeyError for bug #417253 This error is triggered by corrupt cache entries. --- diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py index 0af6c20ca..0ab6e0a1f 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: