From b5bb808906b6121cebc9736238bd125252e21460 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 2 Aug 2008 07:23:57 +0000 Subject: Handle missing sets, to avoid KeyError raised from unmerge(). svn path=/main/trunk/; revision=11319 --- pym/_emerge/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- cgit v1.2.3-1-g7c22