From 0390edd5452b081f8efcf412f96d535a1d959457 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 15 Mar 2016 13:13:54 +0100 Subject: Fix bug where the problemresolve can put a pkg into a heisenstate The problemresolver will set the candidate version for pkg P back to the current version if it encounters an impossible to satisfy critical dependency on P. However it did not set the State of the package back as well which lead to a situation where P is neither in Keep,Install,Upgrade,Delete state. Note that this can not be tested via the traditional sh based framework. I added a python-apt based test for this. LP: #1550741 [jak@debian.org: Make the test not fail if apt_pkg cannot be imported] --- apt-pkg/depcache.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/depcache.cc') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 8281949f9..dd18305d2 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1421,7 +1421,12 @@ bool pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(PkgIterator con // the dependency is critical, but can't be installed, so discard the candidate // as the problemresolver will trip over it otherwise trying to install it (#735967) if (Pkg->CurrentVer != 0 && (PkgState[Pkg->ID].iFlags & Protected) != Protected) + { SetCandidateVersion(Pkg.CurrentVer()); + StateCache &State = PkgState[Pkg->ID]; + State.Mode = ModeKeep; + State.Update(Pkg, *this); + } return false; } } -- cgit v1.2.3