chiark / gitweb /
dgit-repos-server: parsetag_general: Switch to $distrofn
[dgit.git] / infra / dgit-repos-server
index 361fa4a3c32a2009f2586e2246f3e8dc95bb9f7f..eea5d94fc7a465c3ffa4f43c8813a00aed403ae4 100755 (executable)
@@ -572,8 +572,8 @@ sub readtag () {
     $!=0; $_=<T>; defined or die $!;
 }
 
-sub parsetag_general ($;$) {
-    my ($dgititemfn, $need_distro) = @_;
+sub parsetag_general ($$) {
+    my ($dgititemfn, $distrofn) = @_;
     printdebug " parsetag...\n";
 
     my $copyl = $_;
@@ -586,8 +586,7 @@ sub parsetag_general ($;$) {
            while (length) {
                if ($dgititemfn->()) {
                } elsif (s/^distro\=(\S+) //) {
-                   die "$1 != $distro" unless $1 eq $distro;
-                   $need_distro = 0;
+                   $distrofn->($1);
                } elsif (s/^[-+.=0-9a-z]\S* //) {
                } else {
                    die "unknown dgit info in tag ($_)";
@@ -597,7 +596,6 @@ sub parsetag_general ($;$) {
        }
        last if m/^-----BEGIN PGP/;
     }
-    reject "need distro info in tag" if $need_distro;
 
     $_ = $copyl;
     for (;;) {
@@ -629,6 +627,9 @@ sub parsetag () {
            return 0;
        }
        return 1;
+    }, sub {
+       my ($gotdistro) = @_;
+       die "$gotdistro != $distro" unless $gotdistro eq $distro;
     };
 }