summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-03-27 00:20:05 +0100
committerJulian Andres Klode <jak@debian.org>2016-03-27 01:09:14 +0100
commit6df5632313e9ce77c47ee4bcf6e32a028c4534d0 (patch)
treed6094e1ade53ad048d4a2ead2ffba2235aedd2ce /apt-pkg/depcache.cc
parenta2025a9a307bf4796e90623b002a7fa80ae814ef (diff)
Do not mark packages for keep that we want to remove
If the package is marked for removal, keep it marked for removal and do not mark it for keep. If we mark it for keep, we some how later get to a different stage where it is marked for unpack instead of removal. In the example in the bug report, we would get a: SmartUnPack maas-region-controller-min:amd64 (replace version 2.0.0~alpha3+bzr4810-0ubuntu1 with Segmentation fault maas-region-controller-min:amd64 was marked for removal, but we changed it to keep and somehow it thinks that this is to be replaced now instead of removed (probably because the InstallVer != CandidateVer [with InstallVer = 0]). This fixes a regression introduced in release 1.2.7, commit: 0390edd5452b081f8efcf412f96d535a1d959457 Reported-by: LaMont Jones on IRC LP: #1562402
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 4940387a6..b2173d2e4 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1424,8 +1424,11 @@ bool pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(PkgIterator con
{
SetCandidateVersion(Pkg.CurrentVer());
StateCache &State = PkgState[Pkg->ID];
- State.Mode = ModeKeep;
- State.Update(Pkg, *this);
+ if (State.Mode != ModeDelete)
+ {
+ State.Mode = ModeKeep;
+ State.Update(Pkg, *this);
+ }
}
return false;
}