Fix exception on nonexisted use flag (#91)

This commit is contained in:
niku64 2020-04-09 17:00:10 +03:00 committed by GitHub
parent 19078d6b91
commit f42101e552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -743,7 +743,10 @@ def install(name=None,
changes[param] = {'version': version(param),
'old': {'use': all_uses[0]},
'new': {'use': all_uses[1]}}
else: continue
else:
if '[' in target:
log.warning(
'Package {0} does not have an update or flag changes, but requested to be installed, so there is probably a nonexistent flag in requested use, use equery to confirm that', target)
targets.append(target)
else:

View File

@ -2462,10 +2462,11 @@ def latest(
slot = kwargs.get('slot', None)
if slot is not None:
fname += ':{0}'.format(slot)
if fromrepo is not None:
fname += '::{0}'.format(fromrepo)
if __salt__['portage_config.is_changed_uses'](fname):
log.debug(
'Package is up-to-date, but USE flags are changed so we need to reinstall it'
)
'Package {0} is up-to-date, but uses were changed, so we need to reinstall it', fname)
targets[pkg] = cur[pkg]
else:
# Package either a) is not installed, or b) is installed and has an