summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-05-15 09:00:37 +0000
committerNorbert Preining <preining@logic.at>2016-05-15 09:00:37 +0000
commit71b584cd9c5233528247cb6f0bc261c086609372 (patch)
tree391693eff2324fc9782604150a892694890c27a6 /Master/tlpkg/TeXLive/TLUtils.pm
parente6a47083a9a9864220a01cfa2136b260ac70abf0 (diff)
fix creating of missing download target dir
git-svn-id: svn://tug.org/texlive/trunk@41144 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm12
1 files 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;