portageq: fix all_best_visible to fail early
authorZac Medico <zmedico@gentoo.org>
Sat, 18 Jun 2011 17:53:42 +0000 (10:53 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 Jun 2011 17:53:42 +0000 (10:53 -0700)
This will fix bug #372193.

bin/portageq

index fa713889ac59aed5b3417a4428535660e94fc831..a13ca998c102a74792a3d9c05369d6e3f4791348 100755 (executable)
@@ -461,9 +461,11 @@ def all_best_visible(argv):
        """<root>
        Returns all best_visible packages (without .ebuild).
        """
-       if (len(argv) < 1):
-               print("ERROR: insufficient parameters!")
-       
+       if len(argv) < 1:
+               sys.stderr.write("ERROR: insufficient parameters!\n")
+               sys.stderr.flush()
+               return 2
+
        #print portage.db[argv[0]]["porttree"].dbapi.cp_all()
        for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all():
                mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))