Merge pull request #28413 from rallytime/bp-28400

Back-port #28400 to 2015.5
This commit is contained in:
Mike Place 2015-10-29 12:06:46 -06:00
commit 30d5f7bbae

View file

@ -326,27 +326,28 @@ def _find_install_targets(name=None,
for name, version in desired.items()
if not (name in cur_pkgs and version in (None, cur_pkgs[name]))
])
problems = _preflight_check(not_installed, **kwargs)
comments = []
if problems.get('no_suggest'):
comments.append(
'The following package(s) were not found, and no possible '
'matches were found in the package db: '
'{0}'.format(', '.join(sorted(problems['no_suggest'])))
)
if problems.get('suggest'):
for pkgname, suggestions in problems['suggest'].items():
if not_installed:
problems = _preflight_check(not_installed, **kwargs)
comments = []
if problems.get('no_suggest'):
comments.append(
'Package {0!r} not found (possible matches: {1})'
.format(pkgname, ', '.join(suggestions))
'The following package(s) were not found, and no possible '
'matches were found in the package db: '
'{0}'.format(', '.join(sorted(problems['no_suggest'])))
)
if comments:
if len(comments) > 1:
comments.append('')
return {'name': name,
'changes': {},
'result': False,
'comment': '. '.join(comments).rstrip()}
if problems.get('suggest'):
for pkgname, suggestions in six.iteritems(problems['suggest']):
comments.append(
'Package \'{0}\' not found (possible matches: {1})'
.format(pkgname, ', '.join(suggestions))
)
if comments:
if len(comments) > 1:
comments.append('')
return {'name': name,
'changes': {},
'result': False,
'comment': '. '.join(comments).rstrip()}
# Check current versions against desired versions
targets = {}