diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 8a776159ca2..81c502d288c 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1064,10 +1064,21 @@ sub download_file { } my $url; if ($relpath =~ m;^file://*(.*)$;) { + my $filetoopen = "/$1"; # $dest is a file name, we have to get the respective dirname - my $par = dirname($dest); - copy("/$1", $par); - return 1; + if ($dest eq "|") { + open(RETFH, "<$filetoopen") or + die("Cannot open $filetoopen for reading"); + # 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; + } + return 0; + } } if ($relpath =~ /^(http|ftp):\/\//) { $url = $relpath; @@ -1516,6 +1527,7 @@ sub process_logging_options { if ($opt_logfile) { open(TLUTILS_LOGFILE, ">$opt_logfile") || die "open(>$opt_logfile) failed: $!\n"; $::LOGFILE = \*TLUTILS_LOGFILE; + $::LOGFILENAME = $opt_logfile; } } |