mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42522 from gtmanfred/2017.7.1
pacman wildcard is only for repository installs
This commit is contained in:
commit
50c1635dcc
1 changed files with 25 additions and 25 deletions
|
@ -579,33 +579,33 @@ def install(name=None,
|
|||
'\'{1}\''.format(version_num, name)
|
||||
)
|
||||
|
||||
if wildcards:
|
||||
# Resolve wildcard matches
|
||||
_available = list_repo_pkgs(*[x[0] for x in wildcards], refresh=refresh)
|
||||
for pkgname, verstr in wildcards:
|
||||
candidates = _available.get(pkgname, [])
|
||||
match = salt.utils.fnmatch_multiple(candidates, verstr)
|
||||
if match is not None:
|
||||
targets.append('='.join((pkgname, match)))
|
||||
else:
|
||||
errors.append(
|
||||
'No version matching \'{0}\' found for package \'{1}\' '
|
||||
'(available: {2})'.format(
|
||||
verstr,
|
||||
pkgname,
|
||||
', '.join(candidates) if candidates else 'none'
|
||||
if wildcards:
|
||||
# Resolve wildcard matches
|
||||
_available = list_repo_pkgs(*[x[0] for x in wildcards], refresh=refresh)
|
||||
for pkgname, verstr in wildcards:
|
||||
candidates = _available.get(pkgname, [])
|
||||
match = salt.utils.fnmatch_multiple(candidates, verstr)
|
||||
if match is not None:
|
||||
targets.append('='.join((pkgname, match)))
|
||||
else:
|
||||
errors.append(
|
||||
'No version matching \'{0}\' found for package \'{1}\' '
|
||||
'(available: {2})'.format(
|
||||
verstr,
|
||||
pkgname,
|
||||
', '.join(candidates) if candidates else 'none'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if refresh:
|
||||
try:
|
||||
# Prevent a second refresh when we run the install command
|
||||
cmd.remove('-y')
|
||||
except ValueError:
|
||||
# Shouldn't happen since we only add -y when refresh is True,
|
||||
# but just in case that code above is inadvertently changed,
|
||||
# don't let this result in a traceback.
|
||||
pass
|
||||
if refresh:
|
||||
try:
|
||||
# Prevent a second refresh when we run the install command
|
||||
cmd.remove('-y')
|
||||
except ValueError:
|
||||
# Shouldn't happen since we only add -y when refresh is True,
|
||||
# but just in case that code above is inadvertently changed,
|
||||
# don't let this result in a traceback.
|
||||
pass
|
||||
|
||||
if not errors:
|
||||
cmd.extend(targets)
|
||||
|
|
Loading…
Add table
Reference in a new issue