summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2011-01-05 13:26:40 -0600
committerPaul Varner <fuzzyray@gentoo.org>2011-01-05 13:26:40 -0600
commita6ac30531de75d545c843d40e43edb8f39080260 (patch)
tree3e6afbe0c67346ed0138bb04a30b0571a48794dc
parent93669a76e1674d123c9a3b816f8fc6a9b5a705c0 (diff)
downloadgentoolkit-a6ac30531de75d545c843d40e43edb8f39080260.tar.gz
equery list: do not raise GentoolkitNoMatches exception in quiet mode
-rw-r--r--pym/gentoolkit/equery/list_.py11
1 files changed, 10 insertions, 1 deletions
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"]: