For bug #161356, fix the SLOT match code to handle a KeyError thrown due to a corrupt...
authorZac Medico <zmedico@gentoo.org>
Sat, 20 Jan 2007 20:02:59 +0000 (20:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 20 Jan 2007 20:02:59 +0000 (20:02 -0000)
svn path=/main/trunk/; revision=5736

pym/portage.py

index e1b0f74456f5e2cbfb41e43a1db7b3cb8c0ff4cb..69ba15cfc1fa8d852509671f40b94808b2150e34 100644 (file)
@@ -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: