X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/47c37a1bfc2f2f372bf057bf68bde0b3b6f0ec8f..610e13842a3718128c03454c5dfcbde49d323281:/apt-pkg/depcache.cc diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 92b073908..8281949f9 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -154,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; @@ -1017,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) { @@ -1182,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; @@ -1281,9 +1282,9 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, Otherwise we remove the offender if needed */ else if (Start.IsNegative() == true && Start->Type != pkgCache::Dep::Obsoletes) { - SPtrArray List = Start.AllTargets(); + std::unique_ptr List(Start.AllTargets()); pkgCache::PkgIterator TrgPkg = Start.TargetPkg(); - for (Version **I = List; *I != 0; I++) + for (Version **I = List.get(); *I != 0; I++) { VerIterator Ver(*this,*I); PkgIterator Pkg = Ver.ParentPkg(); @@ -1468,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 /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -1780,6 +1786,8 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep) const // Policy::GetPriority - Get the priority of the package pin /*{{{*/ APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &/*Pkg*/) { return 0; } +APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::VerIterator const &/*Ver*/, bool /*ConsiderFiles*/) +{ return 0; } APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &/*File*/) { return 0; } /*}}}*/