Fix traceback in equery which (Bug #134053)
authorfuzzyray <fuzzyray@gentoo.org>
Sat, 31 Mar 2007 22:39:20 +0000 (22:39 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Sat, 31 Mar 2007 22:39:20 +0000 (22:39 -0000)
svn path=/; revision=369

trunk/ChangeLog
trunk/src/equery/equery

index 80e6d753113dc464968bf258819e8f7ca46c043a..47e150aa824e63c8a9dfc14eca0578f70948f96b 100644 (file)
@@ -1,3 +1,6 @@
+2007-03-31: Paul Varner <fuzzyray@gentoo.org>
+       * equery: Fix traceback in equery which (Bug #134053)
+
 2007-03-29: Paul Varner <fuzzyray@gentoo.org>
        * gentoolkit: Change package.get_???_deps() methods to try the portage
        tree first, since emerge always uses the portage tree for dependencies.
index bd3e715ed5d03cbcb58afd5adcb00b7b2ae03f65..8fec9fea2c79a7783b802e5e0ab945843a6d25ac 100755 (executable)
@@ -1027,7 +1027,12 @@ class CmdWhich(Command):
                matches = gentoolkit.sort_package_list(matches)
 
                if matches:
-                       print_info(0, os.path.normpath(matches[-1].get_ebuild_path()))
+                       pkg = matches[-1]
+                       ebuild_path = pkg.get_ebuild_path()
+                       if ebuild_path:
+                               print_info(0, os.path.normpath(ebuild_path))
+                       else:
+                               print_warn("There are no ebuilds to satisfy %s" % pkg.get_name())
                else:
                        print_error("No masked or unmasked packages found for " + pp.pkgquery(query))