diff options
author | Julian Andres Klode <jak@debian.org> | 2021-01-08 12:43:23 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2021-01-08 12:43:23 +0000 |
commit | 4d28ddc501738d571c21ff6d41168f6c53ea462d (patch) | |
tree | 8eeb602172e2c9cfc2eeb74a6da44430154da224 | |
parent | bab5f78463de487ab5712ce52f1068ea91d3b8f2 (diff) | |
parent | 5fddde78ad15e1f6160f65465139d2c1e416d047 (diff) |
Merge branch 'pu/autoremove-kernels-in-apt-only' into 'master'
Only autoremove kernels in apt(8); respect --no-auto-remove
See merge request apt-team/apt!149
-rw-r--r-- | apt-private/private-cmndline.cc | 3 | ||||
-rw-r--r-- | apt-private/private-install.cc | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 588dea06b..2049842db 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -506,8 +506,7 @@ static void BinaryCommandSpecificConfiguration(char const * const Binary, char c // we support it anyhow, but allow it on the commandline to take effect // even through it isn't documented as a user who doesn't want it wouldn't // ask for it - _config->Set("Binary::apt-get::APT::Get::AutomaticRemove", false); - _config->Set("Binary::apt::APT::Get::AutomaticRemove", false); + _config->Set("APT::Get::AutomaticRemove", ""); } } #undef CmdMatches diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index b110cbdc3..402f8f4b6 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -699,8 +699,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<PseudoPkg OpTextProgress Progress(*_config); bool const distUpgradeMode = strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0; - if (distUpgradeMode) - _config->CndSet("APT::Get::AutomaticRemove::Kernels", "true"); + if (distUpgradeMode && _config->Find("Binary") == "apt") + _config->CndSet("APT::Get::AutomaticRemove::Kernels", _config->FindB("APT::Get::AutomaticRemove", true)); bool resolver_fail = false; if (distUpgradeMode == true || UpgradeMode != APT::Upgrade::ALLOW_EVERYTHING) |