From a6ac30531de75d545c843d40e43edb8f39080260 Mon Sep 17 00:00:00 2001 From: Paul Varner Date: Wed, 5 Jan 2011 13:26:40 -0600 Subject: [PATCH] equery list: do not raise GentoolkitNoMatches exception in quiet mode --- pym/gentoolkit/equery/list_.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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"]: -- 2.26.2