From f825ba7a351b8b8ea77cac1352ac21e2874370f6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 26 Jan 2009 00:13:10 +0000 Subject: use File::Temp::tempdir instead of mktemp git-svn-id: svn://tug.org/texlive/trunk@11974 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Master/tlpkg') 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 -- 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 + +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 @@ -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); -- cgit v1.2.3