aptpkg will specify --install-recommends if enabled by the SLS

This is to resolve #35422. The "install_recommends" flag in the SLS file
would apply --no-install-recommends to false, but if set to True it
would not enforce --install-recommends. It should not be assumed that
apt will install the recommends packages, since that can be disabled
globally.

https://github.com/saltstack/salt/issues/35422
This commit is contained in:
david kruger 2016-08-12 17:40:08 -04:00
parent 2ef596673f
commit f54bf445b5

View file

@ -559,8 +559,11 @@ def install(name=None,
else:
cmd_prefix += ['-o', 'DPkg::Options::=--force-confold']
cmd_prefix += ['-o', 'DPkg::Options::=--force-confdef']
if 'install_recommends' in kwargs and not kwargs['install_recommends']:
cmd_prefix.append('--no-install-recommends')
if 'install_recommends' in kwargs:
if not kwargs['install_recommends']:
cmd_prefix.append('--no-install-recommends')
else:
cmd_prefix.append('--install-recommends')
if 'only_upgrade' in kwargs and kwargs['only_upgrade']:
cmd_prefix.append('--only-upgrade')
if skip_verify: