summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-26 03:55:22 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-26 03:55:22 +0000
commitadb42e097ed7d4fb29d42eef7f2fbc790e822773 (patch)
tree32a9458e898b0a170e77cf9274354abd0e762f8a
parent2b123f4eb00f310eb6e5af3cd6fc8f69755e3c73 (diff)
downloadportage-adb42e097ed7d4fb29d42eef7f2fbc790e822773.tar.gz
portage-adb42e097ed7d4fb29d42eef7f2fbc790e822773.tar.bz2
portage-adb42e097ed7d4fb29d42eef7f2fbc790e822773.zip
Optimize the algorithm used for expansion of set
arguments into atoms. svn path=/main/trunk/; revision=8305
-rw-r--r--pym/_emerge/__init__.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 785e2f746..0d730b783 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6504,8 +6504,14 @@ def emerge_main():
newargs.append(a)
myfiles = newargs
del newargs
- for s in settings.sets:
- if SETPREFIX+s in myfiles:
+ newargs = []
+ for a in myfiles:
+ if a.startswith(SETPREFIX):
+ s = a[len(SETPREFIX):]
+ if s not in settings.sets:
+ 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 packagesets[s].supportsOperation("unmerge"):
print "emerge: the given set %s does not support unmerge operations" % s
@@ -6513,11 +6519,14 @@ def emerge_main():
if not settings.setconfig.getSetAtoms(s):
print "emerge: '%s' is an empty set" % s
else:
- myfiles.extend(settings.setconfig.getSetAtoms(s))
+ newargs.extend(settings.setconfig.getSetAtoms(s))
mysets[s] = settings.sets[s]
for e in settings.sets[s].errors:
print e
- myfiles.remove(SETPREFIX+s)
+ else:
+ newargs.append(a)
+ myfiles = newargs
+ del newargs
# Need to handle empty sets specially, otherwise emerge will react
# with the help message for empty argument lists
if oldargs and not myfiles: