From: Ian Jackson Date: Sat, 6 Jul 2019 10:22:00 +0000 (+0100) Subject: dgit-repos-server: parsetag_general: Switch to $distrofn X-Git-Tag: archive/debian/9.1~74 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=1e23175a29f2070c6a39ba565d6453fb887c6a0e dgit-repos-server: parsetag_general: Switch to $distrofn No functional change. Signed-off-by: Ian Jackson --- diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index 361fa4a3..eea5d94f 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -572,8 +572,8 @@ sub readtag () { $!=0; $_=; 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; }; }