From: fuzzyray Date: Fri, 22 Aug 2008 21:38:27 +0000 (-0000) Subject: Fix find_packages and find_installed_packages to print a warning instead of a traceba... X-Git-Tag: gentoolkit-0.2.4.3~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32593bfabaffa866abd335d078e8f7272c0dc3af;p=gentoolkit.git Fix find_packages and find_installed_packages to print a warning instead of a traceback when an InvalidAtom exception occurs. (Bug #234358) svn path=/; revision=507 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 17124b6..8f1956c 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,8 @@ +2008-08-22: Paul Varner + * gentoolkit: Fix find_packages and find_installed_packages to print + a warning instead of a traceback when an InvalidAtom exception occurs. + (Bug #234358) + 2008-08-22: Paul Varner * equery: Fix equery belongs to strip multiple slashes from path names. (Bug #234584) diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index 6dba7db..bf2b1b1 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -10,6 +10,7 @@ import portage from gentoolkit import * from package import * +from pprinter import print_warn try: from portage.util import unique_array except ImportError: @@ -37,6 +38,9 @@ def find_packages(search_key, masked=False): t += portage.db["/"]["vartree"].dbapi.match(cp) else: raise ValueError(e) + except portage_exception.InvalidAtom, e: + print_warn("Invalid Atom: '%s'" % str(e)) + return [] # Make the list of packages unique t = unique_array(t) t.sort() @@ -54,6 +58,9 @@ def find_installed_packages(search_key, masked=False): t += portage.db["/"]["vartree"].dbapi.match(cp) else: raise ValueError(e) + except portage_exception.InvalidAtom, e: + print_warn("Invalid Atom: '%s'" % str(e)) + return [] return [Package(x) for x in t] def find_best_match(search_key):