if requested argv cannot be matched to anything, exit with non-zero status
authorMike Frysinger <vapier@gentoo.org>
Sat, 27 Jan 2007 04:49:42 +0000 (04:49 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 27 Jan 2007 04:49:42 +0000 (04:49 -0000)
svn path=/main/trunk/; revision=5791

bin/portageq

index c3adf9114fff4b00ff82aef80709d0063556d9c6..8a70bed8704d0dc98b68eee8c5de3e8bf726a33b 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