From d7a596b5783fa41f4c3292d53e1be0879825c617 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 20 Jan 2007 20:02:59 +0000 Subject: For bug #161356, fix the SLOT match code to handle a KeyError thrown due to a corrupt ebuild. svn path=/main/trunk/; revision=5736 --- pym/portage.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pym/portage.py') 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: -- cgit v1.2.3-1-g7c22