diff options
author | Norbert Preining <preining@logic.at> | 2008-07-10 10:27:48 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-07-10 10:27:48 +0000 |
commit | 3726af04a35d7fbf92f6da3ecef2b54d238f27f6 (patch) | |
tree | d9b2764ec33b25e902bb8bcf16065e8c1f924da7 /Master/tlpkg/TeXLive/TLUtils.pm | |
parent | 1c7f172eca48842ba65a3b1069c92059832bf3cb (diff) |
TLUtils: process_logging_options now also sets $::LOGFILENAME
TLUtils: download_file: fix stupid error when downloading to | and returning 1
tlmgr/tlmgrgui: use process_logging_options, and transfer between the two
back and forth. Well at least from tlmgr to tlmgrgui, unfortunately we
cannot transfer it backwards without overwriting stuff already written there
git-svn-id: svn://tug.org/texlive/trunk@9427 c570f23f-e606-0410-a88d-b1316a301751
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; } } |