summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-07 05:42:19 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-07 05:42:19 +0000
commitc6a7c98c8e3b2dd9535c95ef729032240eeb50c6 (patch)
treeccfa83a5fd8b260677f893a8c7220c42a8005d43
parent1a9d31c2f070851f7a31a43e6cc291f477d5f0e9 (diff)
downloadportage-c6a7c98c8e3b2dd9535c95ef729032240eeb50c6.tar.gz
portage-c6a7c98c8e3b2dd9535c95ef729032240eeb50c6.tar.bz2
portage-c6a7c98c8e3b2dd9535c95ef729032240eeb50c6.zip
Perform set argument validation in emerge_main() even for
values actions that need to expland sets themselves. svn path=/main/trunk/; revision=8863
-rw-r--r--pym/_emerge/__init__.py76
1 files changed, 38 insertions, 38 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 9458882af..f5aa77631 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6924,45 +6924,45 @@ def emerge_main():
# world file, the depgraph performs set expansion later. It will get
# confused about where the atoms came from if it's not allowed to
# expand them itself.
- if myaction not in (None,):
- newargs = []
- for a in myfiles:
- if a in ("system", "world"):
- newargs.append(SETPREFIX+a)
- else:
- newargs.append(a)
- myfiles = newargs
- del newargs
- newargs = []
- for a in myfiles:
- if a.startswith(SETPREFIX):
- s = a[len(SETPREFIX):]
- if s not in sets:
- print "emerge: there are no sets to satisfy %s." % \
- colorize("INFORM", s)
- return 1
- if myaction in unmerge_actions and \
- not sets[s].supportsOperation("unmerge"):
- sys.stderr.write("emerge: the given set %s does " + \
- "not support unmerge operations\n" % s)
- return 1
- if not setconfig.getSetAtoms(s):
- print "emerge: '%s' is an empty set" % s
- elif myaction != None:
- newargs.extend(setconfig.getSetAtoms(s))
- else:
- newargs.append(SETPREFIX+s)
- for e in sets[s].errors:
- print e
+ do_not_expand = (None, )
+ newargs = []
+ for a in myfiles:
+ if a in ("system", "world"):
+ newargs.append(SETPREFIX+a)
+ else:
+ newargs.append(a)
+ myfiles = newargs
+ del newargs
+ newargs = []
+ for a in myfiles:
+ if a.startswith(SETPREFIX):
+ s = a[len(SETPREFIX):]
+ if s not in sets:
+ print "emerge: there are no sets to satisfy %s." % \
+ colorize("INFORM", s)
+ return 1
+ if myaction in unmerge_actions and \
+ not sets[s].supportsOperation("unmerge"):
+ sys.stderr.write("emerge: the given set %s does " + \
+ "not support unmerge operations\n" % s)
+ return 1
+ if not setconfig.getSetAtoms(s):
+ print "emerge: '%s' is an empty set" % s
+ elif myaction not in do_not_expand:
+ newargs.extend(setconfig.getSetAtoms(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:
- print "emerge: no targets left after set expansion"
- return 0
+ newargs.append(SETPREFIX+s)
+ for e in sets[s].errors:
+ print e
+ 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:
+ print "emerge: no targets left after set expansion"
+ return 0
if ("--tree" in myopts) and ("--columns" in myopts):
print "emerge: can't specify both of \"--tree\" and \"--columns\"."