X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b53c9cea2902572822bbbece5bac236c1bbf846e..610e13842a3718128c03454c5dfcbde49d323281:/apt-pkg/depcache.cc?ds=sidebyside diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 39bbe484f..8281949f9 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; @@ -1467,6 +1469,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 /*{{{*/ // --------------------------------------------------------------------- /* */