Commit 6feb4e38 by James Cammarata

Fail apt package install when nothing is matched by the fnmatch pattern

Related to PR #3823
parent 5c39c659
...@@ -185,6 +185,10 @@ def expand_pkgspec_from_fnmatches(m, pkgspec, cache): ...@@ -185,6 +185,10 @@ def expand_pkgspec_from_fnmatches(m, pkgspec, cache):
else: else:
matches = fnmatch.filter( matches = fnmatch.filter(
[pkg.name for pkg in cache], pkgname_or_fnmatch_pattern) [pkg.name for pkg in cache], pkgname_or_fnmatch_pattern)
if len(matches) == 0:
m.fail_json(msg="No package(s) matching '%s' available" % str(pkgname_or_fnmatch_pattern))
else:
new_pkgspec.extend(matches) new_pkgspec.extend(matches)
else: else:
new_pkgspec.append(pkgname_or_fnmatch_pattern) new_pkgspec.append(pkgname_or_fnmatch_pattern)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment