apt: use --auto-remove with dist-upgrade (#37594)

This commit is contained in:
Martin Krizek 2018-03-28 12:18:36 +02:00 committed by GitHub
parent 4688a09aa8
commit 447b342662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -739,7 +739,7 @@ def cleanup(m, purge=False, force=False, operation=None,
def upgrade(m, mode="yes", force=False, default_release=None,
use_apt_get=False,
dpkg_options=expand_dpkg_options(DPKG_OPTIONS), autoremove=None):
dpkg_options=expand_dpkg_options(DPKG_OPTIONS), autoremove=False):
if autoremove:
autoremove = '--auto-remove'
@ -756,7 +756,7 @@ def upgrade(m, mode="yes", force=False, default_release=None,
if mode == "dist" or (mode == "full" and use_apt_get):
# apt-get dist-upgrade
apt_cmd = APT_GET_CMD
upgrade_command = "dist-upgrade"
upgrade_command = "dist-upgrade %s" % (autoremove)
elif mode == "full" and not use_apt_get:
# aptitude full-upgrade
apt_cmd = APTITUDE_CMD