if requested argv cannot be matched to anything, exit with non-zero status (trunk...
authorZac Medico <zmedico@gentoo.org>
Fri, 22 Jun 2007 00:18:41 +0000 (00:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 22 Jun 2007 00:18:41 +0000 (00:18 -0000)
svn path=/main/branches/2.1.2/; revision=6924

bin/portageq

index 1a59af8bca2dae485d4d56d5074ac003d71e1b9a..6147e5627f7832eb7435d7000e11685821828c8a 100755 (executable)
@@ -133,7 +133,12 @@ def best_visible(argv):
                sys.exit(2)
        try:
                mylist=portage.db[argv[0]]["porttree"].dbapi.match(argv[1])
-               print portage.best(mylist)
+               visible=portage.best(mylist)
+               if visible:
+                       print visible
+                       sys.exit(0)
+               else:
+                       sys.exit(1)
        except KeyError:
                sys.exit(1)
 best_visible.uses_root = True