find, uninstall: improved user interaction in the case of empty DB (#2278)

This commit is contained in:
Massimiliano Culpo 2016-11-09 16:36:45 +01:00 committed by Todd Gamblin
parent 1b64213b10
commit 01e42bfea0
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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('')