summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d4710d)
raw | patch | inline | side by side (parent: 1d4710d)
author | martin@catalyst.net.nz <martin@catalyst.net.nz> | |
Sun, 11 Sep 2005 09:26:05 +0000 (21:26 +1200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Sep 2005 17:51:57 +0000 (10:51 -0700) |
Switched from backwards hard-coded tmp directory creation to using
File::Temp::tempdir() to create the directory inside $TMP_PATH or
what the user has provided via the -t parameter.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
File::Temp::tempdir() to create the directory inside $TMP_PATH or
what the user has provided via the -t parameter.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-archimport.perl | patch | blob | history |
diff --git a/git-archimport.perl b/git-archimport.perl
index 518a0ea9141ecd9976c29ccbaf1130e7e9946fd1..3749b8b5728f7bdb0f6adb317b25ecfa81902042 100755 (executable)
--- a/git-archimport.perl
+++ b/git-archimport.perl
- create tag objects instead of ref tags
- audit shell-escaping of filenames
- - better handling of temp directories
- hide our private tags somewhere smarter
- find a way to make "cat *patches | patch" safe even when patchfiles are missing newlines
use warnings;
use Getopt::Std;
use File::Spec;
-use File::Temp qw(tempfile);
+use File::Temp qw(tempfile tempdir);
use File::Path qw(mkpath);
use File::Basename qw(basename dirname);
use String::ShellQuote;
@ARGV >= 1 or usage();
my @arch_roots = @ARGV;
-my $tmp = $opt_t;
-$tmp ||= '/tmp';
-$tmp .= '/git-archimport/';
+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);
+$opt_v && print "+ Using $tmp as temporary directory\n";
my @psets = (); # the collection
my %psets = (); # the collection, by name