]> git.saurik.com Git - apt.git/commitdiff
policy: Assign per-version pins
authorJulian Andres Klode <jak@debian.org>
Mon, 10 Aug 2015 09:21:11 +0000 (11:21 +0200)
committerJulian Andres Klode <jak@debian.org>
Mon, 10 Aug 2015 09:30:36 +0000 (11:30 +0200)
apt-pkg/policy.cc

index 5d7ab0e6b50a736e15881e859e59d69a661a051e..370819e0bc9ea4a9c14e034adc4f767a75789b1f 100644 (file)
@@ -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;
+           }
+        }
       }
    }