* Correct the section in apt_preferences(5) on interpre...
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:03:07 +0000 (17:03 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:03:07 +0000 (17:03 +0000)
Author: mdz
Date: 2003-08-12 00:17:37 GMT
* Correct the section in apt_preferences(5) on interpreting priorities
to show that zero is not a valid priority, and print a warning if such
a pin is encountered in the preferences file (Closes: #204971)

apt-pkg/policy.cc
debian/changelog
doc/apt_preferences.5.sgml
po/apt-all.pot

index 228d858..d8b8825 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: policy.cc,v 1.9 2002/11/06 06:43:14 jgg Exp $
+// $Id: policy.cc,v 1.10 2003/08/12 00:17:37 mdz Exp $
 /* ######################################################################
 
    Package Version Policy implementation
@@ -293,8 +293,14 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
       }
       for (; Word != End && isspace(*Word) != 0; Word++);
 
-      Plcy.CreatePin(Type,Name,string(Word,End),
-                    Tags.FindI("Pin-Priority"));
+      short int priority = Tags.FindI("Pin-Priority", 0);
+      if (priority == 0)
+      {
+         _error->Warning(_("No priority (or zero) specified for pin"));
+         continue;
+      }
+
+      Plcy.CreatePin(Type,Name,string(Word,End),priority);
    }
 
    Plcy.InitDefaults();
index 193d777..f44a5e4 100644 (file)
@@ -1,3 +1,11 @@
+apt (0.5.10) unstable; urgency=low
+
+  * Correct the section in apt_preferences(5) on interpreting priorities
+    to show that zero is not a valid priority, and print a warning if such
+    a pin is encountered in the preferences file (Closes: #204971)
+
+ --
+
 apt (0.5.9) unstable; urgency=low
 
   * Oh well, apt isn't going to make it into testing anytime soon due to
index 7fa2afd..5496bc6 100644 (file)
@@ -44,7 +44,8 @@ Several instances of the same version of a package may be available when
 the &sources-list; file contains references to more than one source.
 In this case <command>apt-get</command> downloads the instance listed
 earliest in the &sources-list; file.
-The APT preferences file does not affect the choice of instance.
+The APT preferences file does not affect the choice of instance, only
+the choice of version.
 </para>
 
 <RefSect2><Title>APT's Default Priority Assignments</>
@@ -248,7 +249,7 @@ or the installed version is more recent</simpara></listitem>
 unless there is a version available belonging to some other
 distribution or the installed version is more recent</simpara></listitem>
 <varlistentry>
-<term>0 &lt;= P &lt;=100</term>
+<term>0 &lt; P &lt;=100</term>
 <listitem><simpara>causes a version to be installed
 only if there is no installed version of the package</simpara></listitem>
 </varlistentry>
index 26567a9..f56b659 100644 (file)
@@ -2136,6 +2136,10 @@ msgstr ""
 msgid "Did not understand pin type %s"
 msgstr ""
 
+#: apt-pkg/policy.cc:299
+msgid "No priority (or zero) specified for pin"
+msgstr ""
+
 #: apt-pkg/pkgcachegen.cc:74
 msgid "Cache has an incompatible versioning system"
 msgstr ""