소스 검색

policy: Assign per-version pins

Julian Andres Klode 11 년 전
부모
커밋
7fd9c353e1
1개의 변경된 파일과 11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      apt-pkg/policy.cc

+ 11 - 0
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;
+	    }
+	 }
       }
    }