From: Eric Wong Date: Thu, 24 Nov 2005 07:50:27 +0000 (-0800) Subject: archimport: fix -t tmpdir switch X-Git-Tag: v0.99.9m^2~13 X-Git-Url: https://git.octo.it/?p=git.git;a=commitdiff_plain;h=5744f27794c284758a5c7956b9e5d5669c5dd318 archimport: fix -t tmpdir switch set TMPDIR env correctly if -t is passed from the command-line. setting TMPDIR => 1 as an argument to tempdir() has no effect otherwise Signed-off-by: Eric Wong Signed-off-by: Martin Langhoff --- diff --git a/git-archimport.perl b/git-archimport.perl index b7e24808..2ed2e3c0 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -88,9 +88,8 @@ usage if $opt_h; @ARGV >= 1 or usage(); my @arch_roots = @ARGV; -my ($tmpdir, $tmpdirname) = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1); -my $tmp = $opt_t || 1; -$tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1); +$ENV{'TMPDIR'} = $opt_t if $opt_t; # $ENV{TMPDIR} will affect tempdir() calls: +my $tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1); $opt_v && print "+ Using $tmp as temporary directory\n"; my @psets = (); # the collection