fix for equery which masked-package
authorgenone <genone@gentoo.org>
Fri, 6 Feb 2004 23:39:17 +0000 (23:39 -0000)
committergenone <genone@gentoo.org>
Fri, 6 Feb 2004 23:39:17 +0000 (23:39 -0000)
svn path=/; revision=80

trunk/src/equery/equery

index fa7e2e6a498c148d703a643a093172cc86acf3a6..6160a821a54d52418228b6f114c89d44011dc671 100755 (executable)
@@ -676,7 +676,11 @@ class CmdWhich(Command):
                matches = gentoolkit.find_packages(query)
                matches = gentoolkit.sort_package_list(matches)
 
-               print os.path.normpath(matches[-1].get_ebuild_path())
+               if matches:
+                       print os.path.normpath(matches[-1].get_ebuild_path())
+               else:
+                       print red("!!!"), "no unmasked packages found for %s" % query
+                       print
                                        
        def shortHelp(self):
                return turquoise("pkgspec") + " - print full path to ebuild for package " + turquoise("pkgspec")