From: fuzzyray Date: Fri, 9 Mar 2007 04:05:19 +0000 (-0000) Subject: Improved handling of KeyError in equery depends command (Bug #169929). X-Git-Tag: gentoolkit-0.2.4.3~161 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f6ec88204b28e3c07eba062902884d331c45741f;p=gentoolkit.git Improved handling of KeyError in equery depends command (Bug #169929). svn path=/; revision=352 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 89723ee..19eef9d 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2007-03-08 Paul Varner + * equery: Improved handling of KeyError in equery depends command + (Bug #169929) + 2007-03-07 Paul Varner * revdep-rebuild: Change ordering algorithm to use --deep instead of --emptytree on the advice of zmedico diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 0acf7a2..ff80da5 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -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]):