summaryrefslogtreecommitdiff
path: root/Master/tlpkg/etc
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-09-26 23:52:09 +0000
committerNorbert Preining <preining@logic.at>2008-09-26 23:52:09 +0000
commit959875327b112d5265da9414253323d1f5526efb (patch)
tree3e3a93cd327e7956c3d24df35db1c0fe9461af53 /Master/tlpkg/etc
parent9330c8222cbb0da80eacdc55a540076b4082ef11 (diff)
add tempfile patch
git-svn-id: svn://tug.org/texlive/trunk@10736 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/etc')
-rw-r--r--Master/tlpkg/etc/tempfile-for-tlpdb.diff39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/tempfile-for-tlpdb.diff b/Master/tlpkg/etc/tempfile-for-tlpdb.diff
new file mode 100644
index 00000000000..82008f3f3e9
--- /dev/null
+++ b/Master/tlpkg/etc/tempfile-for-tlpdb.diff
@@ -0,0 +1,39 @@
+Index: TeXLive/TLPDB.pm
+===================================================================
+--- TeXLive/TLPDB.pm (revision 10575)
++++ TeXLive/TLPDB.pm (working copy)
+@@ -60,6 +60,9 @@
+ use TeXLive::TLUtils qw(dirname mkdirhier member win32 info debug ddebug tlwarn);
+ use TeXLive::TLPOBJ;
+
++use File::Temp qw/tempfile/;
++
++
+ my $_listdir;
+
+ =pod
+@@ -211,13 +214,20 @@
+ # if we have lzmadec available we try the lzma file
+ if (defined($::progs{'lzmadec'})) {
+ # we first try the lzma compressed file
+- my $tmpdir = TeXLive::TLUtils::get_system_tmpdir();
+- my $bn = TeXLive::TLUtils::basename("$path");
+- my $lzmafile = "$tmpdir/$bn.lzma";
++ #
++ # we have to create a temp file to download to
++ my ($lzmafh, $lzmafile) = tempfile();
++ # now $lzmafh filehandle is open, the file created
++ # TLUtils::download_file will just overwrite what is there
++ # on windows that doesn't work, so we close the fh immediately
++ # is this secure???
++ close($lzmafh);
+ my $lzmafile_quote = $lzmafile;
+ # this is a variable of the whole sub as we have to remove the file
+ # before returning
+- $tlpdbfile = "$tmpdir/$bn";
++ my $tlpdbfh;
++ ($tlpdbfh, $tlpdbfile) = tempfile();
++ close($tlpdbfh);
+ my $tlpdbfile_quote = $tlpdbfile;
+ if (win32()) {
+ $lzmafile =~ s!/!\\!g;