From: Zac Medico Date: Fri, 26 Oct 2007 03:55:22 +0000 (-0000) Subject: Optimize the algorithm used for expansion of set X-Git-Tag: v2.2_pre1~505 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=adb42e097ed7d4fb29d42eef7f2fbc790e822773;p=portage.git Optimize the algorithm used for expansion of set arguments into atoms. svn path=/main/trunk/; revision=8305 --- 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: