chiark / gitweb /
dgit: Introduce "deliberatelies"
[dgit.git] / infra / dgit-repos-server
index a2916d6221ceaff7ffa13d07c4c4794ff3fee339..56fc4fd0ef766bbfd617aac8dfc34148ccfd55c2 100755 (executable)
@@ -100,6 +100,8 @@ our $workrepo;
 our $keyrings;
 our @lockfhs;
 our $debug='';
+our @deliberatelies;
+our $policy;
 
 #----- utilities -----
 
@@ -331,6 +333,20 @@ sub parsetag () {
     for (;;) {
        print PT or die $!;
        $!=0; $_=<T>; defined or die "missing signature? $!";
+       if (m/^\[dgit ([^"].*)\]$/) { # [dgit "something"] is for future
+           $_ = $1." ";
+           for (;;) {
+               if (s/^distro\=(\S+) //) {
+                   die "$1 != $distro" unless $1 eq $distro;
+               } elsif (s/^(--deliberately-$package_re) //) {
+                   push @deliberatelies, $1;
+               } elsif (s/^[-+.=0-9a-z]\S* //) {
+               } else {
+                   die "unknown dgit info in tag";
+               }
+           }
+           next;
+       }
        last if m/^-----BEGIN PGP/;
     }
     for (;;) {
@@ -463,7 +479,7 @@ sub tagh1 ($) {
 
 sub checks () {
     debug "checks";
-    checksuite();
+
     tagh1('type') eq 'commit' or reject "tag refers to wrong kind of object";
     tagh1('object') eq $commit or reject "tag refers to wrong commit";
     tagh1('tag') eq $tagname or reject "tag name in tag is wrong";
@@ -474,6 +490,8 @@ sub checks () {
     debug "translated version $v";
     $tagname eq "debian/$v" or die;
 
+    checksuite();
+
     # check that our ref is being fast-forwarded
     debug "oldcommit $oldcommit";
     if ($oldcommit =~ m/[^0]/) {