diff options
-rw-r--r-- | apt-pkg/edsp.cc | 6 | ||||
-rw-r--r-- | apt-private/private-install.cc | 9 | ||||
-rwxr-xr-x | test/integration/test-apt-get-autoremove | 6 |
3 files changed, 13 insertions, 8 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 225d86de0..90f20472e 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -343,7 +343,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres pkgCache::VerIterator Ver(Cache.GetCache(), Cache.GetCache().VerP + VerIdx[id]); Cache.SetCandidateVersion(Ver); if (type == "Install") - Cache.MarkInstall(Ver.ParentPkg(), false, 0, false); + { + pkgCache::PkgIterator const P = Ver.ParentPkg(); + if (Cache[P].Mode != pkgDepCache::ModeInstall) + Cache.MarkInstall(P, false, 0, false); + } else if (type == "Remove") Cache.MarkDelete(Ver.ParentPkg(), false); else if (type == "Autoremove") { diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 3647ca99d..28b8d9a7b 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -560,13 +560,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, if (Fix != NULL && _config->FindB("APT::Get::AutoSolving", true) == true) { - for (unsigned short i = 0; order[i] != 0; ++i) - { - if (order[i] != MOD_INSTALL) - continue; - InstallAction.propergateReleaseCandiateSwitching(helper.selectedByRelease, c0out); - InstallAction.doAutoInstall(); - } + InstallAction.propergateReleaseCandiateSwitching(helper.selectedByRelease, c0out); + InstallAction.doAutoInstall(); } if (_error->PendingError() == true) diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 454b47976..455079cf1 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -95,3 +95,9 @@ testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s + +testsuccess aptget autoremove debhelper -y --allow-change-held-packages +testdpkgnotinstalled 'po-debconf' 'debhelper' +testmarkedauto +testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1 +testmarkedauto 'po-debconf' |