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
# 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
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:
+["package_"+x for x in ["mask", "unmask", "use", "keywords"]]
del x
+SETPREFIX = "@"
+
class SetConfigError(Exception):
pass
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