From 01e42bfea0ce442e03483ea48350a74f5587e29e Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 9 Nov 2016 16:36:45 +0100 Subject: find, uninstall: improved user interaction in the case of empty DB (#2278) --- lib/spack/spack/cmd/find.py | 2 +- lib/spack/spack/cmd/uninstall.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index 27949ef5db..542114c8c1 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -115,7 +115,7 @@ def find(parser, args): q_args = query_arguments(args) query_specs = args.specs(**q_args) # Exit early if no package matches the constraint - if not query_specs: + if not query_specs and args.constraint: msg = "No package matches the query: {0}".format(args.contraint) tty.msg(msg) return diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index f48b28ff73..2f7e15ba55 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -101,7 +101,7 @@ def concretize_specs(specs, allow_multiple_matches=False, force=False): has_errors = True # No installed package matches the query - if len(matching) == 0: + if len(matching) == 0 and spec is not any: tty.error("%s does not match any installed packages." % spec) has_errors = True @@ -196,6 +196,10 @@ def uninstall(parser, args): uninstall_list = get_uninstall_list(args) + if not uninstall_list: + tty.msg("There are no package to uninstall.") + return + if not args.yes_to_all: tty.msg("The following packages will be uninstalled : ") print('') -- cgit v1.2.3-60-g2f50