perform sanity checks for set configuration even if myaction is None
authorMarius Mauch <genone@gentoo.org>
Tue, 4 Dec 2007 10:14:38 +0000 (10:14 -0000)
committerMarius Mauch <genone@gentoo.org>
Tue, 4 Dec 2007 10:14:38 +0000 (10:14 -0000)
svn path=/main/trunk/; revision=8840

pym/_emerge/__init__.py
pym/portage/sets/__init__.py

index 0d97e6190312cd6ad7d544dbddd4d964dc991b34..3fa8f1769c0bd4e9c2db30672ec1f7fb3f6e68d2 100644 (file)
@@ -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:
index d92eb3130f118dccfda354a027396fce83635a53..2d36f481406bea3c32a440bd90eaa41418fb16f1 100644 (file)
@@ -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))