From 1c62ab240a76122afb95c6df7de19ec5ba5cee1a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 20 Apr 2007 17:42:06 +0200 Subject: * apt-pkg/policy.cc: - allow multiple packages (thanks to David Foerster) --- apt-pkg/policy.cc | 9 ++++++++- debian/changelog | 2 ++ doc/apt_preferences.5.xml | 7 ++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index d8b8825c2..35a50425b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -36,6 +36,7 @@ #include #include +#include /*}}}*/ 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(); diff --git a/debian/changelog b/debian/changelog index 8b566e5c4..bcdeac310 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 18 Dec 2006 19:39:05 +0100 diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 3e50bef8c..175339f5a 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -143,10 +143,11 @@ separated by blank lines. Records can have one of two forms, a specific form and a general form. -The specific form assigns a priority (a "Pin-Priority") to a -specified package and specified version or version range. For example, +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 perl package whose version number begins with "5.8". +the perl package whose version number begins with "5.8". +Multiple packages can be separated by spaces. Package: perl -- cgit v1.2.3