summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-02 07:23:57 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-02 07:23:57 +0000
commitb5bb808906b6121cebc9736238bd125252e21460 (patch)
tree13c047c38bf0f8c08578dfbe2ab086631c5f00fa
parent54ee3f3c676b0a7c21753041f530bebf1370369a (diff)
downloadportage-b5bb808906b6121cebc9736238bd125252e21460.tar.gz
portage-b5bb808906b6121cebc9736238bd125252e21460.tar.bz2
portage-b5bb808906b6121cebc9736238bd125252e21460.zip
Handle missing sets, to avoid KeyError raised from unmerge().
svn path=/main/trunk/; revision=11319
-rw-r--r--pym/_emerge/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 19c86ff4e..cd80e1d5e 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -10370,6 +10370,7 @@ def unmerge(root_config, myopts, unmerge_action,
# we don't want to unmerge packages that are still listed in user-editable package sets
# listed in "world" as they would be remerged on the next update of "world" or the
# relevant package sets.
+ unknown_sets = set()
for cp in xrange(len(pkgmap)):
for cpv in pkgmap[cp]["selected"].copy():
try:
@@ -10385,6 +10386,17 @@ def unmerge(root_config, myopts, unmerge_action,
# removed from "world" later on)
if s in root_config.setconfig.active or (s == "world" and not root_config.setconfig.active):
continue
+
+ if s not in sets:
+ if s in unknown_sets:
+ continue
+ unknown_sets.add(s)
+ out = portage.output.EOutput()
+ out.eerror(("Unknown set '@%s' in " + \
+ "%svar/lib/portage/world_sets") % \
+ (s, root_config.root))
+ continue
+
# only check instances of EditablePackageSet as other classes are generally used for
# special purposes and can be ignored here (and are usually generated dynamically, so the
# user can't do much about them anyway)