chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix debugprefix
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index d31b9b1db9d306338896fa6dfae01a4b719fd672..e12bfdc86b6b0d78a647110388a407d41b1bdba1 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-46,6
+46,7
@@
our $noquilt = 0;
our $existing_package = 'dpkg';
our $cleanmode = 'dpkg-source';
our $we_are_responder;
our $existing_package = 'dpkg';
our $cleanmode = 'dpkg-source';
our $we_are_responder;
+our $initiator_tempdir;
our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
@@
-115,7
+116,7
@@
sub dscfn ($) {
sub changesopts () { return @changesopts[1..$#changesopts]; }
our $us = 'dgit';
sub changesopts () { return @changesopts[1..$#changesopts]; }
our $us = 'dgit';
-our $debugprefix = '
';
+our $debugprefix = '';
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
@@
-1416,9
+1417,9
@@
sub cmd_remote_push_responder {
@ARGV = @ARGV[$nrargs..$#ARGV];
die unless @rargs;
my ($dir) = @rargs;
@ARGV = @ARGV[$nrargs..$#ARGV];
die unless @rargs;
my ($dir) = @rargs;
+ $debugprefix = ' ';
changedir $dir;
$we_are_responder = 1;
changedir $dir;
$we_are_responder = 1;
- $debugprefix = ' ';
autoflush STDOUT 1;
responder_send_command("dgit-remote-push-ready");
&cmd_push;
autoflush STDOUT 1;
responder_send_command("dgit-remote-push-ready");
&cmd_push;
@@
-1429,6
+1430,7
@@
our $i_tmp;
sub i_cleanup {
local ($@);
return unless defined $i_tmp;
sub i_cleanup {
local ($@);
return unless defined $i_tmp;
+ return if defined $initiator_tempdir;
changedir "/";
eval { rmtree $i_tmp; };
}
changedir "/";
eval { rmtree $i_tmp; };
}
@@
-1458,7
+1460,13
@@
sub cmd_rpush {
my @cmd = (@ssh, $host, shellquote @rdgit);
printcmd \*DEBUG,$debugprefix."+",@cmd;
eval {
my @cmd = (@ssh, $host, shellquote @rdgit);
printcmd \*DEBUG,$debugprefix."+",@cmd;
eval {
- $i_tmp = tempdir();
+ if (defined $initiator_tempdir) {
+ rmtree $initiator_tempdir;
+ mkdir $initiator_tempdir, 0700 or die "$initiator_tempdir: $!";
+ $i_tmp = $initiator_tempdir;
+ } else {
+ $i_tmp = tempdir();
+ }
my $pid = open2(\*RO, \*RI, @cmd);
changedir $i_tmp;
initiator_expect { m/^dgit-remote-push-ready/ };
my $pid = open2(\*RO, \*RI, @cmd);
changedir $i_tmp;
initiator_expect { m/^dgit-remote-push-ready/ };
@@
-1767,6
+1775,11
@@
sub parseopts () {
} elsif (m/^--existing-package=(.*)/s) {
push @ropts, $_;
$existing_package = $1;
} elsif (m/^--existing-package=(.*)/s) {
push @ropts, $_;
$existing_package = $1;
+ } elsif (m/^--initiator-tempdir=(.*)/s) {
+ $initiator_tempdir = $1;
+ $initiator_tempdir =~ m#^/# or
+ badusage "--initiator-tempdir must be used specify an".
+ " absolute, not relative, directory."
} elsif (m/^--distro=(.*)/s) {
push @ropts, $_;
$idistro = $1;
} elsif (m/^--distro=(.*)/s) {
push @ropts, $_;
$idistro = $1;