summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/policy.cc12
-rw-r--r--debian/changelog8
-rw-r--r--doc/apt_preferences.5.sgml5
-rw-r--r--po/apt-all.pot4
4 files changed, 24 insertions, 5 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 228d858a9..d8b8825c2 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -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();
diff --git a/debian/changelog b/debian/changelog
index 193d7779b..f44a5e4da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/doc/apt_preferences.5.sgml b/doc/apt_preferences.5.sgml
index 7fa2afdf2..5496bc62d 100644
--- a/doc/apt_preferences.5.sgml
+++ b/doc/apt_preferences.5.sgml
@@ -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>
diff --git a/po/apt-all.pot b/po/apt-all.pot
index 26567a914..f56b65999 100644
--- a/po/apt-all.pot
+++ b/po/apt-all.pot
@@ -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 ""