diff options
author | Norbert Preining <preining@logic.at> | 2009-01-26 00:13:10 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-01-26 00:13:10 +0000 |
commit | f825ba7a351b8b8ea77cac1352ac21e2874370f6 (patch) | |
tree | bae92fa572aa70bb8d5464eb99cdde9fedcdf766 | |
parent | fcc99c721274faed249824c5d18e8c769b6d83b0 (diff) |
use File::Temp::tempdir instead of mktemp
git-svn-id: svn://tug.org/texlive/trunk@11974 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 26218b8dfe2..0000676ff26 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -29,6 +29,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::getenv($string); TeXLive::TLUtils::which($string); TeXLive::TLUtils::get_system_tmpdir(); + TeXLive::TLUtils::tl_tmpdir(); TeXLive::TLUtils::xchdir($dir); TeXLive::TLUtils::xsystem(@args); @@ -123,6 +124,7 @@ BEGIN { use Cwd; use Digest::MD5; use Getopt::Long; +use File::Temp; use TeXLive::TLConfig; $::opt_verbosity = 0; # see process_logging_options @@ -426,6 +428,16 @@ sub get_system_tmpdir { return "$systmp"; } +=item C<tl_tmpdir> + +Create a temporary directory which is cleaned up as soon as the program +is terminated. + +=cut + +sub tl_tmpdir { + return (File::Temp::tempdir(CLEANUP => 1)); +} =item C<xchdir($dir)> @@ -1415,7 +1427,7 @@ sub setup_unix_one { # try to copy it to a temp directory and make it executable # # create tmp dir only when necessary - chomp ($tmp = `mktemp -d`) unless defined($tmp); + $tmp = TeXLive::TLUtils::tl_tmpdir() unless defined($tmp); # probably we are running from DVD and want to copy it to # some temporary location copy($def, $tmp); |