archimport: fix -t tmpdir switch
set TMPDIR env correctly if -t <tmpdir> is passed from the command-line. setting TMPDIR => 1 as an argument to tempdir() has no effect otherwise Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Eric Wong committed
Nov 23, 2005 at 23:50 UTC
5744f27794c284758a5c7956b9e5d5669c5dd318
1 file changed
+2
-3
git-archimport.perl
+2
-3
@@ -88,9 +88,8 @@ usage if $opt_h;
88
@ARGV >= 1 or usage();
89
my @arch_roots = @ARGV;
90
91
-my ($tmpdir, $tmpdirname) = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
92
-my $tmp = $opt_t || 1;
93
-$tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
91
+$ENV{'TMPDIR'} = $opt_t if $opt_t; # $ENV{TMPDIR} will affect tempdir() calls:
92
+my $tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
93
$opt_v && print "+ Using $tmp as temporary directory\n";
94
95
my @psets = (); # the collection