X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=60020fc2fe8d09ede9d17bc7d08c8900706b8037;hp=d31b9b1db9d306338896fa6dfae01a4b719fd672;hb=caa11936c6ac7059d0e6f46612cebaf44d5c9115;hpb=589cbeb80f59adb3c6c1b0bd1c74b9e4b0246950 diff --git a/dgit b/dgit index d31b9b1d..60020fc2 100755 --- a/dgit +++ b/dgit @@ -46,6 +46,7 @@ our $noquilt = 0; 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)"); @@ -1429,6 +1430,7 @@ our $i_tmp; sub i_cleanup { local ($@); return unless defined $i_tmp; + return if defined $initiator_tempdir; changedir "/"; eval { rmtree $i_tmp; }; } @@ -1458,7 +1460,13 @@ sub cmd_rpush { 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/ }; @@ -1767,6 +1775,11 @@ sub parseopts () { } 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;