Bladeren bron

versions with a pin of -1 shouldn't be a candidate (Closes: #355237)

David Kalnischkies 17 jaren geleden
bovenliggende
commit
9f5bf66a62
3 gewijzigde bestanden met toevoegingen van 13 en 4 verwijderingen
  1. 8 0
      apt-pkg/policy.cc
  2. 1 0
      debian/changelog
  3. 4 4
      po/apt-all.pot

+ 8 - 0
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

+ 1 - 0
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)

+ 4 - 4
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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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 ""