use a @ prefix for sets, and replace world/system with their real prefixed names...
authorMarius Mauch <genone@gentoo.org>
Fri, 26 Oct 2007 00:55:26 +0000 (00:55 -0000)
committerMarius Mauch <genone@gentoo.org>
Fri, 26 Oct 2007 00:55:26 +0000 (00:55 -0000)
svn path=/main/trunk/; revision=8301

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

index 1bd0ae72aa9f0cba020a8e49e30fc73643bf698a..2aaf5fb332b225381cf9a337ea4943750e09b87c 100644 (file)
@@ -52,7 +52,7 @@ import portage.exception
 from portage.data import secpass
 from portage.util import normalize_path as normpath
 from portage.util import writemsg
-from portage.sets import SetConfig, make_default_config
+from portage.sets import SetConfig, make_default_config, SETPREFIX
 from portage.sets.profiles import PackagesSystemSet as SystemSet
 from portage.sets.base import InternalPackageSet
 from portage.sets.files import WorldSet
@@ -6496,8 +6496,15 @@ def emerge_main():
        # only expand sets for actions taking package arguments
        oldargs = myfiles[:]
        if myaction not in ["search", "metadata", "sync"]:
+               newargs = []
+               for a in myfiles:
+                       if a in ("system", "world"):
+                               newargs.append(SETPREFIX+a)
+                       else:
+                               newargs.append(a)
+               myfiles = newargs
                for s in settings.sets:
-                       if s in myfiles:
+                       if SETPREFIX+s in myfiles:
                                # TODO: check if the current setname also resolves to a package name
                                if myaction in ["unmerge", "prune", "clean", "depclean"] and not packagesets[s].supportsOperation("unmerge"):
                                        print "emerge: the given set %s does not support unmerge operations" % s
@@ -6509,7 +6516,7 @@ def emerge_main():
                                        mysets[s] = settings.sets[s]
                                for e in settings.sets[s].errors:
                                        print e
-                               myfiles.remove(s)
+                               myfiles.remove(SETPREFIX+s)
                # Need to handle empty sets specially, otherwise emerge will react 
                # with the help message for empty argument lists
                if oldargs and not myfiles:
index 8497e15874fb34b35d65575bb91be80995978ef4..4d5ce25b512cad1596c90bb807505202fc0dde58 100644 (file)
@@ -10,6 +10,8 @@ DEFAULT_SETS = ["world", "system", "everything", "security"] \
        +["package_"+x for x in ["mask", "unmask", "use", "keywords"]]
 del x
 
+SETPREFIX = "@"
+
 class SetConfigError(Exception):
        pass
 
@@ -96,7 +98,7 @@ class SetConfig(SafeConfigParser):
                myset = self.getSetsWithAliases()[setname]
                myatoms = myset.getAtoms()
                for n in myset.getNonAtoms():
-                       if n in self.aliases:
+                       if n[0] == SETPREFIX and n[1:] in self.aliases:
                                myatoms.update(self.getSetAtoms(n))
                return myatoms