[PATCH 3/9] fix -t tmpdir switch
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Nov 24, 2005, 07:50 UTC
- Message-ID
- <20051124075027.GD4789@mail.yhbt.net>
- In-Reply-To
- <20051124074857.GC4789@mail.yhbt.net>
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>
---
git-archimport.perl | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
applies-to: 015fcfae8cdd564f0993940c5bac303c41913b1a 25aadaf3ebc18fcc3c7948dc831d3f93447b03b6
diff --git a/git-archimport.perl b/git-archimport.perl index b7e2480..2ed2e3c 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 --- 0.99.9.GIT