Handle InvalidAtom from vardbapi.match() in has_version.
authorZac Medico <zmedico@gentoo.org>
Mon, 5 Jul 2010 09:40:32 +0000 (02:40 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 5 Jul 2010 09:40:32 +0000 (02:40 -0700)
bin/portageq

index 5a4364fe8c2d8aea93a05cd02a0bb50c4da9eaf1..34a538599d912ee71d9c3a93c2fc890a9fc56901 100755 (executable)
@@ -99,6 +99,10 @@ def has_version(argv):
                        sys.exit(1)
        except KeyError:
                sys.exit(1)
+       except portage.exception.InvalidAtom:
+               portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
+                       noiselevel=-1)
+               return 2
 has_version.uses_root = True