зеркало из https://github.com/microsoft/git.git
[PATCH] archimport - better handling of temp dirs
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>
This commit is contained in:
Родитель
1d4710d06c
Коммит
127bf00f7d
|
@ -23,7 +23,6 @@ See man (1) git-archimport for more details.
|
||||||
|
|
||||||
- create tag objects instead of ref tags
|
- create tag objects instead of ref tags
|
||||||
- audit shell-escaping of filenames
|
- audit shell-escaping of filenames
|
||||||
- better handling of temp directories
|
|
||||||
- hide our private tags somewhere smarter
|
- hide our private tags somewhere smarter
|
||||||
- find a way to make "cat *patches | patch" safe even when patchfiles are missing newlines
|
- find a way to make "cat *patches | patch" safe even when patchfiles are missing newlines
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
use File::Spec;
|
use File::Spec;
|
||||||
use File::Temp qw(tempfile);
|
use File::Temp qw(tempfile tempdir);
|
||||||
use File::Path qw(mkpath);
|
use File::Path qw(mkpath);
|
||||||
use File::Basename qw(basename dirname);
|
use File::Basename qw(basename dirname);
|
||||||
use String::ShellQuote;
|
use String::ShellQuote;
|
||||||
|
@ -72,9 +71,10 @@ usage if $opt_h;
|
||||||
@ARGV >= 1 or usage();
|
@ARGV >= 1 or usage();
|
||||||
my @arch_roots = @ARGV;
|
my @arch_roots = @ARGV;
|
||||||
|
|
||||||
my $tmp = $opt_t;
|
my ($tmpdir, $tmpdirname) = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
|
||||||
$tmp ||= '/tmp';
|
my $tmp = $opt_t || 1;
|
||||||
$tmp .= '/git-archimport/';
|
$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
|
||||||
my %psets = (); # the collection, by name
|
my %psets = (); # the collection, by name
|
||||||
|
|
Загрузка…
Ссылка в новой задаче