diff options
author | Julian Andres Klode <jak@debian.org> | 2015-08-10 11:21:11 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2015-08-10 11:30:36 +0200 |
commit | 7fd9c353e1149dc657086a718761e8e1ff05dcce (patch) | |
tree | 101dc1a40f864d9775baa08b93aeeb798277a91f /apt-pkg/policy.cc | |
parent | 5bfd306ee16fd1be012dd2cd01ae52ff4179176a (diff) |
policy: Assign per-version pins
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 5d7ab0e6b..370819e0b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -284,6 +284,17 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Priority = Priority; P->Data = Data; matched = true; + + // Find matching version(s) and copy the pin into it + pkgVersionMatch Match(P->Data,P->Type); + for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() != true; Ver++) + { + if (Match.VersionMatches(Ver)) { + Pin *VP = VerPins + Ver->ID; + if (VP->Type == pkgVersionMatch::None) + *VP = *P; + } + } } } |