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") {
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)
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'