Support specifying exclude list as multiple arguments.
authorMichał Górny <gentoo@mgorny.alt.pl>
Wed, 19 May 2010 19:39:26 +0000 (21:39 +0200)
committerZac Medico <zmedico@gentoo.org>
Thu, 20 May 2010 04:16:23 +0000 (21:16 -0700)
Instead of relying on user to provide the whole exclude list as a
space-separated list in a single argument (which is uncomfortable),
allow him/her to specify '--exclude' multiple times, joining the
provided atom lists together.

pym/_emerge/depgraph.py
pym/_emerge/main.py

index 9687ef527e656bc0758429142f3c83752ddcb511..728ced29b3e619e3e68591e7815885e415af1305 100644 (file)
@@ -94,7 +94,7 @@ class _frozen_depgraph_config(object):
                self._required_set_names = set(["world"])
 
                self.excluded_pkgs = InternalPackageSet()
-               for x in myopts.get("--exclude", "").split():
+               for x in ' '.join(myopts.get("--exclude", [])).split():
                        try:
                                x = Atom(x)
                        except portage.exception.InvalidAtom:
index 9f7a20da5ee9bdf7204a31eeda66b2f42472bf6e..5422d32bbd3b3abd4f8007da2b9a4a087dac18df 100644 (file)
@@ -565,7 +565,7 @@ def parse_opts(tmpcmdline, silent=False):
                                "Emerge won't  install any ebuild or binary package that " + \
                                "matches any of the given package atoms.",
 
-                       "action" : "store"
+                       "action" : "append"
                },
 
                "--fail-clean": {
@@ -735,7 +735,7 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.exclude:
                exclude = []
                bad_atoms = []
-               for x in myoptions.exclude.split():
+               for x in ' '.join(myoptions.exclude).split():
                        bad_atom = False
                        try:
                                atom = portage.dep.Atom(x)