summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-20 20:02:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-20 20:02:59 +0000
commitd7a596b5783fa41f4c3292d53e1be0879825c617 (patch)
treebf356d106f7e304c0409576f5be4371c59fe7abc /pym
parente768571187d1655fbb558c23d61fa2983e48e411 (diff)
downloadportage-d7a596b5783fa41f4c3292d53e1be0879825c617.tar.gz
portage-d7a596b5783fa41f4c3292d53e1be0879825c617.tar.bz2
portage-d7a596b5783fa41f4c3292d53e1be0879825c617.zip
For bug #161356, fix the SLOT match code to handle a KeyError thrown due to a corrupt ebuild.
svn path=/main/trunk/; revision=5736
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py10
1 files changed, 8 insertions, 2 deletions
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: