diff options
-rw-r--r-- | apt-pkg/depcache.cc | 17 | ||||
-rwxr-xr-x | test/integration/test-bug-618848-always-respect-user-requests | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index cd5558461..425918b43 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1324,7 +1324,24 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, break; } while (Start++ != End); if (not foundSolution && End.IsCritical()) + { + StateCache &State = PkgState[Pkg->ID]; + if (not State.Protect()) + { + RemoveSizes(Pkg); + RemoveStates(Pkg); + if (Pkg->CurrentVer != 0) + State.InstallVer = State.CandidateVer = Pkg.CurrentVer(); + else + State.InstallVer = State.CandidateVer = nullptr; + State.Mode = ModeKeep; + State.Update(Pkg, *this); + AddStates(Pkg); + Update(Pkg); + AddSizes(Pkg); + } return false; + } } toInstall.clear(); diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests index fa190a93d..c2e62b834 100755 --- a/test/integration/test-bug-618848-always-respect-user-requests +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -19,7 +19,6 @@ Building dependency tree... MarkDelete exim4-daemon-light:i386 < 1.0 @ii mK Ib > FU=0 MarkInstall exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0 Ignore MarkInstall of libdb4.8:i386 < 1.0 @ii pmR > as its mode (Delete) is protected - MarkDelete exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0 MarkDelete exim4:i386 < 1.0 @ii mK Ib > FU=0 The following packages will be REMOVED: exim4 exim4-daemon-light libdb4.8 |