From: David Kalnischkies Date: Wed, 1 Jul 2009 08:25:41 +0000 (+0200) Subject: versions with a pin of -1 shouldn't be a candidate (Closes: #355237) X-Git-Tag: 0.7.22~13^2~8 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/9f5bf66a6218d1aec3f42713084078c18947eade?hp=--cc versions with a pin of -1 shouldn't be a candidate (Closes: #355237) --- 9f5bf66a6218d1aec3f42713084078c18947eade 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 diff --git a/debian/changelog b/debian/changelog index ab8da4c6c..412435fad 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 12e15110e..199b7f843 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 ""