sub lref () { return "refs/heads/".lbranch(); }
sub lrref () { return "refs/remotes/$remotename/$csuite"; }
sub rrref () { return "refs/$branchprefix/$csuite"; }
-sub debiantag ($) { return "debian/$_[0]"; }
+sub debiantag ($) {
+ my ($v) = @_;
+ $v =~ y/~:/_%/;
+ return "debian/$v";
+}
sub dscfn ($) { return "${package}_$_[0].dsc"; }
-c<name>=<value> set git config option (used directly by dgit too)
END
+our $later_warning_msg = <<END;
+Perhaps the upload is stuck in incoming. Using the version from git.
+END
+
sub badusage {
print STDERR "$us: @_\n", $helpmsg or die $!;
exit 8;
'dgit.default.username' => '',
'dgit.default.archive-query-default-component' => 'main',
'dgit.default.ssh' => 'ssh',
- 'dgit-distro.debian.git-host' => 'dgit.debian.net',
+ 'dgit-distro.debian.git-host' => 'git.debian.org',
'dgit-distro.debian.git-proto' => 'git+ssh://',
'dgit-distro.debian.git-path' => '/git/dgit-repos',
'dgit-distro.debian.git-check' => 'ssh-cmd',
$outputhash = make_commit qw(../commit2.tmp);
} elsif ($vcmp > 0) {
print STDERR <<END or die $!;
+
Version actually in archive: $cversion (older)
Last allegedly pushed/uploaded: $oversion (newer or same)
-Perhaps the upload is stuck in incoming. Using the version from git.
+$later_warning_msg
END
$outputhash = $upload_hash;
} elsif ($outputhash ne $upload_hash) {
unless $upload_hash;
$hash = $dsc_hash;
ensure_we_have_orig();
+ if (is_fast_fwd($dsc_hash,$upload_hash)) {
+ print STDERR <<END or die $!;
+
+Git commit in archive is behind the last version allegedly pushed/uploaded.
+Commit referred to by archive: $dsc_hash
+Last allegedly pushed/uploaded: $upload_hash
+$later_warning_msg
+END
+ $hash = $upload_hash;
+ }
} else {
$hash = generate_commit_from_dsc();
}
print "[new .dsc left in $dscfn.tmp]\n";
}
if ($sign) {
+ if (!defined $keyid) {
+ $keyid = access_cfg('keyid','RETURN-UNDEF');
+ }
my @tag_cmd = (@git, qw(tag -s -m),
"Release $dversion for $csuite [dgit]");
push @tag_cmd, qw(-u),$keyid if defined $keyid;
if (fetch_from_archive()) {
is_fast_fwd(lrref(), 'HEAD') or die;
} else {
- fail "package appears to be new in this suite;".
- " if this is intentional, use --new";
+ $new_package or
+ fail "package appears to be new in this suite;".
+ " if this is intentional, use --new";
}
dopush();
}