X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b53c9cea2902572822bbbece5bac236c1bbf846e..0340069cc4709a18ba117090763d9f263de999a9:/apt-pkg/depcache.cc diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 39bbe484f..b2173d2e4 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -153,7 +153,7 @@ bool pkgDepCache::Init(OpProgress * const Prog) State.iFlags = 0; // Figure out the install version - State.CandidateVer = GetCandidateVer(I); + State.CandidateVer = LocalPolicy->GetCandidateVer(I); State.InstallVer = I.CurrentVer(); State.Mode = ModeKeep; @@ -1016,6 +1016,8 @@ struct CompareProviders { if (instA != instB) return instA == false; } + if ((A->CurrentVer == 0 || B->CurrentVer == 0) && A->CurrentVer != B->CurrentVer) + return A->CurrentVer == 0; // Prefer packages in the same group as the target; e.g. foo:i386, foo:amd64 if (A->Group != B->Group) { @@ -1181,7 +1183,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, /* unsatisfiable dependency: IsInstallOkDependenciesSatisfiableByCandidates would have prevented us to get here if not overridden, so just skip - over the problem here as the frontend will know what it is doing */ + over the problem here as the front-end will know what it is doing */ if (Ors == 1 && (DepState[Start->ID] &DepCVer) != DepCVer && Start.IsNegative() == false) continue; @@ -1419,7 +1421,15 @@ 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]; + if (State.Mode != ModeDelete) + { + State.Mode = ModeKeep; + State.Update(Pkg, *this); + } + } return false; } } @@ -1467,6 +1477,11 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) } } /*}}}*/ +pkgCache::VerIterator pkgDepCache::GetCandidateVersion(PkgIterator const &Pkg)/*{{{*/ +{ + return PkgState[Pkg->ID].CandidateVerIter(*this); +} + /*}}}*/ // DepCache::SetCandidateVersion - Change the candidate version /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -1688,11 +1703,7 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache) CurVersion = ""; if (Pkg->CurrentVer != 0) CurVersion = Pkg.CurrentVer().VerStr(); - - // Strip off the epochs for display - CurVersion = StripEpoch(CurVersion); - CandVersion = StripEpoch(CandVersion); - + // Figure out if its up or down or equal Status = Ver.CompareVer(Pkg.CurrentVer()); if (Pkg->CurrentVer == 0 || Pkg->VersionList == 0 || CandidateVer == 0)