Permalink
Browse files

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:
  0390edd

Reported-by: LaMont Jones on IRC
LP: #1562402
  • Loading branch information...
1 parent 2189519 commit 71f2ab088f8e077ba8375e87ee9bb595655f954a @julian-klode committed Mar 26, 2016
Showing with 5 additions and 2 deletions.
  1. +5 −2 apt-pkg/depcache.cc
View
@@ -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;
}

0 comments on commit 71f2ab0

Please sign in to comment.