From 71b584cd9c5233528247cb6f0bc261c086609372 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 15 May 2016 09:00:37 +0000 Subject: fix creating of missing download target dir git-svn-id: svn://tug.org/texlive/trunk@41144 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index c1f9b7fea27..588536d05db 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2064,7 +2064,9 @@ sub unpack { # if the file is now not present, we can use it if (! -r $xzfile) { # try download the file and put it into temp - download_file($what, $xzfile); + if (!download_file($what, $xzfile)) { + return(0, "downloading did not succeed"); + } # remove false downloads check_file($xzfile, $checksum, $size); if ( ! -r $xzfile ) { @@ -2387,6 +2389,13 @@ sub download_file { tlwarn ("download_file: Programs not set up, trying literal wget\n"); $wget = "wget"; } + # + # create output dir if necessary + my $par; + if ($dest ne "|") { + $par = dirname($dest); + mkdirhier ($par) unless -d "$par"; + } my $url; if ($relpath =~ m;^file://*(.*)$;) { my $filetoopen = "/$1"; @@ -2397,7 +2406,6 @@ sub download_file { # opening to a pipe always succeeds, so we return immediately return \*RETFH; } else { - my $par = dirname ($dest); if (-r $filetoopen) { copy ($filetoopen, $par); return 1; -- cgit v1.2.3