summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-28 09:07:39 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-28 09:07:39 +0000
commit3b9dad5506e62806cd3b0e46adf7f2b23276853b (patch)
treed77a0a74b5f51885fe934beb0a6ac224b1c3a770 /pym/_emerge/__init__.py
parent21edf5b51fbc184961b86025109da897e1ad01e0 (diff)
downloadportage-3b9dad5506e62806cd3b0e46adf7f2b23276853b.tar.gz
portage-3b9dad5506e62806cd3b0e46adf7f2b23276853b.tar.bz2
portage-3b9dad5506e62806cd3b0e46adf7f2b23276853b.zip
Make SetConfig.getSetAtoms() raise a PackageSetNotFound exception when
necessary and add handling code in emerge. This solves an unhandled KeyError that was raise when a nested set did not exist. Thanks to ABCD for reporting. svn path=/main/trunk/; revision=11732
Diffstat (limited to 'pym/_emerge/__init__.py')
-rw-r--r--pym/_emerge/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 73d143e63..1d324998c 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -13698,15 +13698,22 @@ def expand_set_arguments(myfiles, myaction, root_config):
display_missing_pkg_set(root_config, s)
return (None, 1)
setconfig.active.append(s)
+ try:
+ set_atoms = setconfig.getSetAtoms(s)
+ except portage.exception.PackageSetNotFound, e:
+ writemsg_level(("emerge: the given set '%s' " + \
+ "contains a non-existent set named '%s'.\n") % \
+ (s, e), level=logging.ERROR, noiselevel=-1)
+ return (None, 1)
if myaction in unmerge_actions and \
not sets[s].supportsOperation("unmerge"):
sys.stderr.write("emerge: the given set '%s' does " % s + \
"not support unmerge operations\n")
retval = 1
- elif not setconfig.getSetAtoms(s):
+ elif not set_atoms:
print "emerge: '%s' is an empty set" % s
elif myaction not in do_not_expand:
- newargs.extend(setconfig.getSetAtoms(s))
+ newargs.extend(set_atoms)
else:
newargs.append(SETPREFIX+s)
for e in sets[s].errors: