quickpkg: fix '*' in arg extended atom check
authorZac Medico <zmedico@gentoo.org>
Thu, 13 Oct 2011 21:53:45 +0000 (14:53 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 13 Oct 2011 21:53:45 +0000 (14:53 -0700)
This check isn't really accurate due to the =* operator, and we don't
want to reject =* atoms when they omit the category.

bin/quickpkg

index 0982c4a80ece9a1f25475da2dd0c9a73797b8657..a326bd44ad1b9dca41f40cfee2213ddb7ef300a4 100755 (executable)
@@ -188,24 +188,12 @@ def quickpkg_set(options, infos, arg, eout):
                quickpkg_atom(options, infos, atom, eout)
 
 
-def quickpkg_extended_atom(options, infos, arg, eout):
+def quickpkg_extended_atom(options, infos, atom, eout):
        root = portage.settings["ROOT"]
        trees = portage.db[root]
        vartree = trees["vartree"]
        vardb = vartree.dbapi
 
-       try:
-               atom = Atom(arg, allow_wildcard=True, allow_repo=True)
-       except (InvalidAtom, InvalidData):
-               eout.eerror("Invalid atom: %s" % (arg,))
-               infos["missing"].append(arg)
-               return
-
-       if not atom.extended_syntax:
-               # =* operator
-               quickpkg_atom(options, infos, atom, eout)
-               return
-
        require_metadata = atom.slot or atom.repo
        atoms = []
        for cpv in vardb.cpv_all():
@@ -248,10 +236,17 @@ def quickpkg_main(options, args, eout):
        for arg in args:
                if arg[0] == SETPREFIX:
                        quickpkg_set(options, infos, arg, eout)
-               elif '*' in arg:
-                       quickpkg_extended_atom(options, infos, arg, eout)
-               else:
+                       continue
+               try:
+                       atom = Atom(arg, allow_wildcard=True, allow_repo=True)
+               except (InvalidAtom, InvalidData):
+                       # maybe it's valid but missing category (requires dep_expand)
                        quickpkg_atom(options, infos, arg, eout)
+               else:
+                       if atom.extended_syntax:
+                               quickpkg_extended_atom(options, infos, atom, eout)
+                       else:
+                               quickpkg_atom(options, infos, atom, eout)
 
        if not infos["successes"]:
                eout.eerror("No packages found")