diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2009-07-01 10:25:41 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2009-07-01 10:25:41 +0200 |
commit | 9f5bf66a6218d1aec3f42713084078c18947eade (patch) | |
tree | f195cc1b36f9e409df36221394e6bbb906ff5c2d /apt-pkg/policy.cc | |
parent | 6910a2accecd7c8e8493b74130d8dbf3972014a8 (diff) |
versions with a pin of -1 shouldn't be a candidate (Closes: #355237)
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 8 |
1 files changed, 8 insertions, 0 deletions
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 |