From: Zac Medico Date: Sat, 20 Jan 2007 20:02:59 +0000 (-0000) Subject: For bug #161356, fix the SLOT match code to handle a KeyError thrown due to a corrupt... X-Git-Tag: v2.1.2-r3~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d7a596b5783fa41f4c3292d53e1be0879825c617;p=portage.git For bug #161356, fix the SLOT match code to handle a KeyError thrown due to a corrupt ebuild. svn path=/main/trunk/; revision=5736 --- diff --git a/pym/portage.py b/pym/portage.py index e1b0f7445..69ba15cfc 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6101,8 +6101,14 @@ class portdbapi(dbapi): raise KeyError myslot = portage_dep.dep_getslot(mydep) if myslot is not None: - myval = [cpv for cpv in myval \ - if self.aux_get(cpv, ["SLOT"])[0] == myslot] + slotmatches = [] + for cpv in myval: + try: + if self.aux_get(cpv, ["SLOT"])[0] == myslot: + slotmatches.append(cpv) + except KeyError: + pass # ebuild masked by corruption + myval = slotmatches if self.frozen and (level not in ["match-list","bestmatch-list"]): self.xcache[level][mydep]=myval if origdep and origdep != mydep: