From f125904b85b7d59cfa7ecb65b878228a6d6fd6b6 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Tue, 4 Dec 2007 10:14:38 +0000 Subject: perform sanity checks for set configuration even if myaction is None svn path=/main/trunk/; revision=8840 --- pym/_emerge/__init__.py | 11 ++++++----- pym/portage/sets/__init__.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'pym') diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 0d97e6190..3fa8f1769 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6909,14 +6909,14 @@ def emerge_main(): # only expand sets for actions taking package arguments oldargs = myfiles[:] - if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge"): + if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge", None): root_config = trees[settings["ROOT"]]["root_config"] setconfig = root_config.setconfig sets = root_config.sets # emerge relies on the existance of sets with names "world" and "system" for s in ("world", "system"): if s not in sets: - print "emerge: incomplete set configuration, no set defined for \"%s\"" % s + print "emerge: incomplete set configuration, no \"%s\" set defined" % s print " sets defined: %s" % ", ".join(sets) return 1 newargs = [] @@ -6935,15 +6935,16 @@ def emerge_main(): print "emerge: there are no sets to satisfy %s." % \ colorize("INFORM", s) return 1 - # TODO: check if the current setname also resolves to a package name if myaction in ["unmerge", "prune", "clean", "depclean"] and \ - not sets[s].supportsOperation("unmerge"): + not sets[s].supportsOperation("unmerge"): print "emerge: the given set %s does not support unmerge operations" % s return 1 if not setconfig.getSetAtoms(s): print "emerge: '%s' is an empty set" % s - else: + elif action != None: newargs.extend(setconfig.getSetAtoms(s)) + else: + newargs.append(SETPREFIX+s) for e in sets[s].errors: print e else: diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index d92eb3130..2d36f4814 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -83,7 +83,7 @@ class SetConfig(SafeConfigParser): ignorelist = set() ignorelist.add(setname) for n in myset.getNonAtoms(): - if n[0] == SETPREFIX and n[1:] in self.psets + if n[0] == SETPREFIX and n[1:] in self.psets: if n[1:] not in ignorelist: myatoms.update(self.getSetAtoms(n[1:], ignorelist=ignorelist)) -- cgit v1.2.3-1-g7c22