X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=infra%2Fdgit-repos-server;h=177829e9aeffce5ccd60a3e9a832f427c1623fa5;hb=b5e24ca3bdd371aa72e8bd095f86f0b3cbfbbee1;hp=811db69dd38021c3cb845ec781f6f8e81903cdfd;hpb=f50450ae5e1ee0b122570dd17f7839f46ecbee92;p=dgit.git diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index 811db69d..177829e9 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -1073,10 +1073,10 @@ our @hookenvs = qw(distro suitesfile suitesformasterfile policyhook # workrepo and destrepo handled ad-hoc sub mode_tag2upload () { - # PROTOTYPE # CALLER MUST PREVENT MULTIPLE CONCURRENT RUNS IN SAME CWD # If we fail (exit nonzero), caller should capture our stderr, # and retry some bounded number of times in some appropriate way + # Uses whatever ambient gpg key is available @ARGV==2 or die; my $url; @@ -1224,15 +1224,15 @@ END $distro_ok ||= $gotdistro eq $distro; }; - $quit->("other distro") unless $distro_ok; + $quit->("not for this distro") unless $distro_ok; reject "missing \"$_\"" foreach keys %need; + verifytag(); + reject "upstream tag and not commitish, or v-v" unless defined $upstreamt == defined $upstreamc; - verifytag(); - my @dgit; push @dgit, $ENV{DGIT_DRS_DGIT} // 'dgit'; push @dgit, '-wn'; @@ -1244,7 +1244,6 @@ END my @fetch = qw(git fetch origin --unshallow); if (defined $upstreamt) { - runcmd qw(git check-ref-format), "refs/tags/$upstreamt"; runcmd qw(git check-ref-format), "refs/tags/$upstreamt"; my $utagref = "refs/tags/$upstreamt"; push @fetch, "$utagref:$utagref"; @@ -1253,6 +1252,16 @@ END runcmd qw(git checkout -q), "refs/tags/$tagval"; + my $clogp = parsechangelog(); + my $clogf = sub { + my ($f, $exp) = @_; + my $got = getfield $clogp, $f; + return if $got eq $exp; + reject "mismatch: changelog $f $got != $exp"; + }; + $clogf->('Version', $version); + $clogf->('Source', $package); + @fetch = (@dgit, qw(fetch), $suite); debugcmd "+",@_; $!=0; $?=-1; @@ -1261,7 +1270,9 @@ END } # this is just to get the orig, so we don't really care about the ref if (defined $upstreamc) { - $upstreamc eq git_rev_parse "refs/tags/$upstreamt" or die; + my $need_upstreamc = git_rev_parse "refs/tags/$upstreamt"; + $upstreamc eq $need_upstreamc or reject + "upstream-commitish=$upstreamc but tag refers to $need_upstreamc"; runcmd qw(git deborig), "$upstreamc"; } @@ -1271,12 +1282,12 @@ END if (defined $quilt) { push @dgitcmd, "--quilt=$quilt"; if ($quilt =~ m/baredebian/) { - die "needed upstream commmitish with --quilt=baredebian"; + die "needed upstream commmitish with --quilt=baredebian" + unless defined $upstreamc; push @dgitcmd, "--upstream-commitish=$upstreamc"; } } push @dgitcmd, qw(push-source --new --overwrite), $suite; - # xxx what about the key to use? runcmd @dgitcmd;