Explorar el Código

* apt-pkg/policy.cc:
- accept generic release pin expressions again in -t (Closes: #644166)

David Kalnischkies hace 14 años
padre
commit
061c58b61a

+ 2 - 1
apt-pkg/policy.cc

@@ -64,7 +64,8 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
       {
 	 if ((F->Archive != 0 && vm.ExpressionMatches(DefRel, F.Archive()) == true) ||
 	     (F->Codename != 0 && vm.ExpressionMatches(DefRel, F.Codename()) == true) ||
-	     (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true))
+	     (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true) ||
+	     (DefRel.length() > 2 && DefRel[1] == '='))
 	    found = true;
       }
       if (found == false)

+ 3 - 1
debian/changelog

@@ -15,8 +15,10 @@ apt (0.8.15.9) UNRELEASED; urgency=low
     - if a package is garbage, don't try to save it with FixByInstall
   * apt-pkg/init.cc:
     - silently ignore *.orig and *.save files by default
+  * apt-pkg/policy.cc:
+    - accept generic release pin expressions again in -t (Closes: #644166)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 21 Sep 2011 19:36:45 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 03 Oct 2011 23:35:40 +0200
 
 apt (0.8.15.8) unstable; urgency=low
 

+ 21 - 2
test/integration/test-bug-407511-fail-invalid-default-release

@@ -23,18 +23,31 @@ getreleaseversionfromsuite() {
 	fi
 }
 
+getlabelfromsuite() {
+	if [ "$SUITE" = 'unstable' ]; then
+		echo -n 'UnstableTestcases'
+	else
+		echo -n 'Testcases'
+	fi
+}
+
 setupaptarchive
 
 passdist() {
-	msgtest "Test that target-release is accepted" $1
+	msgtest 'Test that target-release is accepted' $1
 	aptget dist-upgrade -t $1 -qq && msgpass || msgfail
+	msgtest 'Test that target-release pins with' $1
+	aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail
 }
 
 faildist() {
-	msgtest "Test that target-release is refused" $1
+	msgtest 'Test that target-release is refused' $1
 	aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass
 }
 
+msgtest 'Test that no default-release is active in this test' 'setup'
+aptcache policy | grep -q ' 990' && msgfall || msgpass
+
 passdist unstable
 passdist sid
 faildist sidd
@@ -45,3 +58,9 @@ passdist 42*
 passdist 4*.0
 faildist 21.0
 faildist 21*
+# we accept, but don't validate the following
+passdist a=unstable
+passdist n=sid
+passdist v=42.0
+passdist c=main
+passdist l=UnstableTestcases