summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-10-22 16:25:40 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-10-22 16:25:40 +0100
commitcaa11936c6ac7059d0e6f46612cebaf44d5c9115 (patch)
tree0dd5864e22191296ca25e62f56980014940d334f /dgit
parent589cbeb80f59adb3c6c1b0bd1c74b9e4b0246950 (diff)
New --initiator-tempdir option.
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit15
1 files changed, 14 insertions, 1 deletions
diff --git a/dgit b/dgit
index d31b9b1..60020fc 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;