Improved handling of KeyError in equery depends command (Bug #169929).
authorfuzzyray <fuzzyray@gentoo.org>
Fri, 9 Mar 2007 04:05:19 +0000 (04:05 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Fri, 9 Mar 2007 04:05:19 +0000 (04:05 -0000)
svn path=/; revision=352

trunk/ChangeLog
trunk/src/equery/equery

index 89723ee0b005c0ac4744cb865c30b1029ee7ce74..19eef9dfe4204a3c7697fd46db6ef24546265b14 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-08 Paul Varner <fuzzyray@gentoo.org>
+       * equery: Improved handling of KeyError in equery depends command
+       (Bug #169929)
+
 2007-03-07 Paul Varner <fuzzyray@gentoo.org>
        * revdep-rebuild: Change ordering algorithm to use --deep instead of
        --emptytree on the advice of zmedico
index 0acf7a264e76f767270c8bbb1119bca58262e8ad..ff80da53b6f26df764c50b11120d5f79e9d939eb 100755 (executable)
@@ -1129,8 +1129,15 @@ class CmdListDepends(Command):
                                # Find all packages matching the dependency
                                depstr = dependency[0]+dependency[2]
                                if not depstr in self.deppkgs:
-                                       depcpvs = map((lambda x: x.get_cpv()), gentoolkit.find_packages(depstr))
-                                       self.deppkgs[depstr] = depcpvs
+                                       try:
+                                               depcpvs = map((lambda x: x.get_cpv()), gentoolkit.find_packages(depstr))
+                                               self.deppkgs[depstr] = depcpvs
+                                       except KeyError, e:
+                                               print_warn("")
+                                               print_warn("Package: " + depstr + " contains invalid dependency specification.")
+                                               print_warn("Portage error: " + str(e))
+                                               print_warn("")
+                                               continue
                                else:
                                        depcpvs = self.deppkgs[depstr]
                                for x in depcpvs:
@@ -1741,7 +1748,7 @@ if __name__ == "__main__":
                                print_error("")
                                print_error("Note: The symbols > and < are used for redirection in the shell")
                                print_error("and must be quoted if either one is used.")
-                               
+
                        else:
                                print_error("Internal portage error, terminating")
                                if len(e[0]):