summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2016-11-09 16:36:45 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2016-11-09 07:36:45 -0800
commit01e42bfea0ce442e03483ea48350a74f5587e29e (patch)
treec13d5492dcafb641fbb306544d8183e65d0168ed /lib
parent1b64213b101ed88b22e118ed56b6c2811661a1c3 (diff)
downloadspack-01e42bfea0ce442e03483ea48350a74f5587e29e.tar.gz
spack-01e42bfea0ce442e03483ea48350a74f5587e29e.tar.bz2
spack-01e42bfea0ce442e03483ea48350a74f5587e29e.tar.xz
spack-01e42bfea0ce442e03483ea48350a74f5587e29e.zip
find, uninstall: improved user interaction in the case of empty DB (#2278)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/find.py2
-rw-r--r--lib/spack/spack/cmd/uninstall.py6
2 files changed, 6 insertions, 2 deletions
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('')