chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
When generating git tags, quote the (uncanonicalised) changelog's Distribution field...
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 6ec99acb31c13b998bc7c3dcdd4c13620dcd7b03..5ea9c26613432c1bbb95fcc4f86f2fa1351c410a 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-120,7
+120,9
@@
our $debugprefix = '';
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
-sub fail { die "$us: @_\n"; }
+sub fail {
+ die $us.($we_are_responder ? " (build host)" : "").": @_\n";
+}
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
@@
-180,7
+182,6
@@
sub changedir ($) {
sub badproto ($$) {
my ($fh, $m) = @_;
fail "connection lost: $!" if $fh->error;
sub badproto ($$) {
my ($fh, $m) = @_;
fail "connection lost: $!" if $fh->error;
- fail "connection terminated" if $fh->eof;
fail "protocol violation; $m not expected";
}
fail "protocol violation; $m not expected";
}
@@
-208,9
+209,8
@@
sub protocol_send_file ($$) {
die "$ourfn: $!" unless defined $got;
last if !$got;
print $fh "data-block ".length($d)."\n" or die $!;
die "$ourfn: $!" unless defined $got;
last if !$got;
print $fh "data-block ".length($d)."\n" or die $!;
- print $d or die $!;
+ print $
fh $
d or die $!;
}
}
- PF->eof or die "$ourfn $!";
PF->error and die "$ourfn $!";
print $fh "data-end\n" or die $!;
close PF;
PF->error and die "$ourfn $!";
print $fh "data-end\n" or die $!;
close PF;
@@
-227,6
+227,7
@@
sub protocol_read_bytes ($$) {
sub protocol_receive_file ($$) {
my ($fh, $ourfn) = @_;
sub protocol_receive_file ($$) {
my ($fh, $ourfn) = @_;
+ printdebug "() $ourfn\n";
open PF, ">", $ourfn or die "$ourfn: $!";
for (;;) {
my ($y,$l) = protocol_expect {
open PF, ">", $ourfn or die "$ourfn: $!";
for (;;) {
my ($y,$l) = protocol_expect {
@@
-239,7
+240,6
@@
sub protocol_receive_file ($$) {
print PF $d or die $!;
}
close PF or die $!;
print PF $d or die $!;
}
close PF or die $!;
- printdebug "() $ourfn\n";
}
#---------- remote protocol support, responder ----------
}
#---------- remote protocol support, responder ----------
@@
-249,7
+249,7
@@
sub responder_send_command ($) {
return unless $we_are_responder;
# called even without $we_are_responder
printdebug "<< $command\n";
return unless $we_are_responder;
# called even without $we_are_responder
printdebug "<< $command\n";
- print $command, "\n" or die $!;
+ print
PO
$command, "\n" or die $!;
}
sub responder_send_file ($$) {
}
sub responder_send_file ($$) {
@@
-257,7
+257,7
@@
sub responder_send_file ($$) {
return unless $we_are_responder;
printdebug "[[ $keyword $ourfn\n";
responder_send_command "file $keyword";
return unless $we_are_responder;
printdebug "[[ $keyword $ourfn\n";
responder_send_command "file $keyword";
- protocol_send_file \*
STDOUT
, $ourfn;
+ protocol_send_file \*
PO
, $ourfn;
}
sub responder_receive_files ($@) {
}
sub responder_receive_files ($@) {
@@
-266,9
+266,9
@@
sub responder_receive_files ($@) {
printdebug "]] $keyword @ourfns\n";
responder_send_command "want $keyword";
foreach my $fn (@ourfns) {
printdebug "]] $keyword @ourfns\n";
responder_send_command "want $keyword";
foreach my $fn (@ourfns) {
- protocol_receive_file \*
STDIN
, $fn;
+ protocol_receive_file \*
PI
, $fn;
}
}
- protocol_expect { m/^files-end$/ } \*
STDIN
;
+ protocol_expect { m/^files-end$/ } \*
PI
;
}
#---------- remote protocol support, initiator ----------
}
#---------- remote protocol support, initiator ----------
@@
-284,7
+284,7
@@
sub progress {
if ($we_are_responder) {
my $m = join '', @_;
responder_send_command "progress ".length($m) or die $!;
if ($we_are_responder) {
my $m = join '', @_;
responder_send_command "progress ".length($m) or die $!;
- print $m or die $!;
+ print
PO
$m or die $!;
} else {
print @_, "\n";
}
} else {
print @_, "\n";
}
@@
-1131,13
+1131,13
@@
sub push_parse_dsc ($$$) {
my $dversion = getfield $dsc, 'Version';
my $dscpackage = getfield $dsc, 'Source';
($dscpackage eq $package && $dversion eq $cversion) or
my $dversion = getfield $dsc, 'Version';
my $dscpackage = getfield $dsc, 'Source';
($dscpackage eq $package && $dversion eq $cversion) or
- fail "$dsc is for $dscpackage $dversion".
+ fail "$dsc
fn
is for $dscpackage $dversion".
" but debian/changelog is for $package $cversion";
}
" but debian/changelog is for $package $cversion";
}
-sub push_mktag ($$$$$$$
$
) {
+sub push_mktag ($$$$$$$) {
my ($head,$clogp,$tag,
my ($head,$clogp,$tag,
- $dsc
,$dsc
fn,
+ $dscfn,
$changesfile,$changesfilewhat,
$tfn) = @_;
$changesfile,$changesfilewhat,
$tfn) = @_;
@@
-1152,6
+1152,7
@@
sub push_mktag ($$$$$$$$) {
}
my $cversion = getfield $clogp, 'Version';
}
my $cversion = getfield $clogp, 'Version';
+ my $clogsuite = getfield $clogp, 'Distribution';
# We make the git tag by hand because (a) that makes it easier
# to control the "tagger" (b) we can do remote signing
# We make the git tag by hand because (a) that makes it easier
# to control the "tagger" (b) we can do remote signing
@@
-1163,7
+1164,7
@@
type commit
tag $tag
tagger $authline
tag $tag
tagger $authline
-$package release $cversion for $csuite [dgit]
+$package release $cversion for $c
log
suite [dgit]
END
close TO or die $!;
END
close TO or die $!;
@@
-1264,13
+1265,14
@@
sub dopush () {
}
responder_send_file('changes',$changesfile);
}
responder_send_file('changes',$changesfile);
+ responder_send_command("param head $head");
my $tfn = sub { ".git/dgit/tag$_[0]"; };
my ($tagobjfn) =
$we_are_responder
? responder_receive_files('signed-tag', $tfn->('.signed.tmp'))
: push_mktag($head,$clogp,$tag,
my $tfn = sub { ".git/dgit/tag$_[0]"; };
my ($tagobjfn) =
$we_are_responder
? responder_receive_files('signed-tag', $tfn->('.signed.tmp'))
: push_mktag($head,$clogp,$tag,
-
$dsc,
"../$dscfn",
+ "../$dscfn",
$changesfile,$changesfile,
$tfn);
$changesfile,$changesfile,
$tfn);
@@
-1422,10
+1424,18
@@
sub cmd_remote_push_responder {
die unless @rargs;
my ($dir) = @rargs;
$debugprefix = ' ';
die unless @rargs;
my ($dir) = @rargs;
$debugprefix = ' ';
- changedir $dir;
$we_are_responder = 1;
$we_are_responder = 1;
+
+ open PI, "<&STDIN" or die $!;
+ open STDIN, "/dev/null" or die $!;
+ open PO, ">&STDOUT" or die $!;
+ autoflush PO 1;
+ open STDOUT, ">&STDERR" or die $!;
autoflush STDOUT 1;
autoflush STDOUT 1;
+
responder_send_command("dgit-remote-push-ready");
responder_send_command("dgit-remote-push-ready");
+
+ changedir $dir;
&cmd_push;
}
&cmd_push;
}
@@
-1521,8
+1531,8
@@
sub i_resp_file ($) {
our %i_param;
our %i_param;
-sub i_param ($) {
- $_[0] =~ m/^(\S+) (.*)$/;
+sub i_
resp_
param ($) {
+ $_[0] =~ m/^(\S+) (.*)$/
or badproto \*RO, "bad param spec"
;
$i_param{$1} = $2;
}
$i_param{$1} = $2;
}
@@
-1551,6
+1561,7
@@
sub i_localname_dsc {
}
sub i_want_signed_tag {
}
sub i_want_signed_tag {
+ printdebug Dumper(\%i_param, $i_dscfn);
defined $i_param{'head'} && defined $i_dscfn
or badproto \*RO, "sequencing error";
my $head = $i_param{'head'};
defined $i_param{'head'} && defined $i_dscfn
or badproto \*RO, "sequencing error";
my $head = $i_param{'head'};
@@
-1559,7
+1570,7
@@
sub i_want_signed_tag {
push_parse_dsc $i_dscfn, 'remote dsc',
push_mktag $head, $i_clogp, $i_tag,
push_parse_dsc $i_dscfn, 'remote dsc',
push_mktag $head, $i_clogp, $i_tag,
- $
dsc, $
i_dscfn,
+ $i_dscfn,
'remote.changes', 'remote changes',
'tag.tag';
'remote.changes', 'remote changes',
'tag.tag';