From 9f5bf66a6218d1aec3f42713084078c18947eade Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 1 Jul 2009 10:25:41 +0200 Subject: [PATCH] versions with a pin of -1 shouldn't be a candidate (Closes: #355237) --- apt-pkg/policy.cc | 8 ++++++++ debian/changelog | 1 + po/apt-all.pot | 8 ++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 98576fc9..e33d563a 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 diff --git a/debian/changelog b/debian/changelog index ab8da4c6..412435fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,7 @@ apt (0.7.22) UNRELEASED; urgency=low * fix typo in apt-pkg/acquire.cc which prevents Dl-Limit to work correctly when downloading from multiple sites (Closes: #534752) * add the various foldmarkers in apt-pkg & cmdline (no code change) + * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) [ Michael Vogt ] * honor the dpkg hold state in new Marker hooks (closes: #64141) diff --git a/po/apt-all.pot b/po/apt-all.pot index 12e15110..199b7f84 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-06-30 21:08+0200\n" +"POT-Creation-Date: 2009-07-01 10:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2381,16 +2381,16 @@ msgstr "" msgid "You may want to run apt-get update to correct these problems" msgstr "" -#: apt-pkg/policy.cc:281 +#: apt-pkg/policy.cc:289 msgid "Invalid record in the preferences file, no Package header" msgstr "" -#: apt-pkg/policy.cc:303 +#: apt-pkg/policy.cc:311 #, c-format msgid "Did not understand pin type %s" msgstr "" -#: apt-pkg/policy.cc:311 +#: apt-pkg/policy.cc:319 msgid "No priority (or zero) specified for pin" msgstr "" -- 2.20.1