* apt-pkg/policy.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2007 15:42:06 +0000 (17:42 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2007 15:42:06 +0000 (17:42 +0200)
  - allow multiple packages (thanks to David Foerster)

apt-pkg/policy.cc
debian/changelog
doc/apt_preferences.5.xml

index d8b8825..35a5042 100644 (file)
@@ -36,6 +36,7 @@
 #include <apti18n.h>
 
 #include <iostream>
+#include <sstream>
                                                                        /*}}}*/
 
 using namespace std;
@@ -300,7 +301,13 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
          continue;
       }
 
-      Plcy.CreatePin(Type,Name,string(Word,End),priority);
+      istringstream s(Name);
+      string pkg;
+      while(!s.eof())
+      {
+        s >> pkg;
+         Plcy.CreatePin(Type, pkg, string(Word,End),priority);
+      };
    }
 
    Plcy.InitDefaults();
index 8b566e5..bcdeac3 100644 (file)
@@ -21,6 +21,8 @@ apt (0.6.47) UNRELEASED; urgency=low
   * [ABI] apt-pkg/acquire.{cc,h}:
     - deal better with duplicated sources.list entries (avoid
       double queuing of  URLs) - this fixes hangs in bzip/gzip
+  * apt-pkg/policy.cc:
+    - allow multiple packages (thanks to David Foerster)
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 18 Dec 2006 19:39:05 +0100
 
index 3e50bef..175339f 100644 (file)
@@ -143,10 +143,11 @@ separated by blank lines.  Records can have one of two forms, a specific form
 and a general form.
 <itemizedlist>
 <listitem>
-<simpara>The specific form assigns a priority (a "Pin-Priority") to a
-specified package and specified version or version range.  For example,
+<simpara>The specific form assigns a priority (a "Pin-Priority") to one or more
+specified packages and specified version or version range.  For example,
 the following record assigns a high priority to all versions of
-the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>".</simpara>
+the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>".
+Multiple packages can be separated by spaces.</simpara>
 
 <programlisting>
 Package: perl