From: Paul Varner Date: Wed, 5 Jan 2011 19:26:40 +0000 (-0600) Subject: equery list: do not raise GentoolkitNoMatches exception in quiet mode X-Git-Tag: gentoolkit-0.3.0~38 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a6ac30531de75d545c843d40e43edb8f39080260;p=gentoolkit.git equery list: do not raise GentoolkitNoMatches exception in quiet mode --- diff --git a/pym/gentoolkit/equery/list_.py b/pym/gentoolkit/equery/list_.py index 941827f..8c4b871 100644 --- a/pym/gentoolkit/equery/list_.py +++ b/pym/gentoolkit/equery/list_.py @@ -19,6 +19,7 @@ from getopt import gnu_getopt, GetoptError import gentoolkit import gentoolkit.pprinter as pp +import gentoolkit.errors as errors from gentoolkit.equery import format_options, mod_usage, CONFIG from gentoolkit.helpers import get_installed_cpvs from gentoolkit.helpers import get_bintree_cpvs @@ -191,7 +192,15 @@ def main(input_args): if not first_run: print() - matches = query.smart_find(**QUERY_OPTS) + # if we are in quiet mode, do not raise GentoolkitNoMatches exception + # TODO: Return a non-zero exit status + try: + matches = query.smart_find(**QUERY_OPTS) + except errors.GentoolkitNoMatches: + if CONFIG['verbose']: + raise + else: + continue # Find duplicate packages if QUERY_OPTS["duplicates"]: