From 9f5bf66a6218d1aec3f42713084078c18947eade Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 1 Jul 2009 10:25:41 +0200 Subject: versions with a pin of -1 shouldn't be a candidate (Closes: #355237) --- apt-pkg/policy.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apt-pkg/policy.cc') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 98576fc91..e33d563a1 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -120,6 +120,14 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg) signed Max = GetPriority(Pkg); pkgCache::VerIterator Pref = GetMatch(Pkg); + // no package = no candidate version + if (Pkg.end() == true) + return Pref; + + // packages with a pin lower than 0 have no newer candidate than the current version + if (Max < 0) + return Pkg.CurrentVer(); + /* Falling through to the default version.. Setting Max to zero effectively excludes everything <= 0 which are the non-automatic priorities.. The status file is given a prio of 100 which will exclude -- cgit v1.2.3