summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/install-tl.pl24
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm9
2 files changed, 23 insertions, 10 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index 02ae6f10f48..dac03e69baf 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -55,6 +55,7 @@ use strict;
#
$::LOGLEVELFILE = $::LOG_NORMAL;
$::LOGLEVELTERMINAL = $::LOG_NORMAL;
+@::LOGLINES = ();
#
# $install{$packagename} == 1 if it should be installed
my %install;
@@ -144,15 +145,6 @@ if ($opt_ddebug) {
if ($opt_dddebug) {
$::LOGLEVELFILE = $::LOG_DDDEBUG;
}
-# try to open a log file
-if ($::LOGLEVELFILE > $::LOG_ZERO) {
- if (open(LOGF,">install-tl.log")) {
- $::LOGFILE = \*LOGF;
- } else {
- warn("Cannot create log file install-tl.log: $!\nContinuing without log file!\n");
- $::LOGLEVELFILE = $::LOG_ZERO;
- }
-}
if ("$opt_media" =~ m/^CD/i) {
$::_media_ = "CD";
} elsif ("$opt_media" =~ m/^NET/i) {
@@ -270,6 +262,20 @@ if (!$finished) {
do_installation();
}
+# now open the log file and write out the log lines
+# try to open a log file
+if ($::LOGLEVELFILE > $::LOG_ZERO) {
+ if (open(LOGF,">$vars{'TEXDIR'}/install-tl.log")) {
+ $::LOGFILE = \*LOGF;
+ foreach my $line(@::LOGLINES) {
+ print $::LOGFILE "$line";
+ }
+ } else {
+ warn("Cannot create log file $vars{'TEXDIR'}/install-tl.log: $!\nNot writing out log lines!\n");
+ $::LOGLEVELFILE = $::LOG_ZERO;
+ }
+}
+
# dump various things to the log file
if (defined($::LOGFILE)) {
print $::LOGFILE "\nDump of vars:\n";
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index a8939c42dca..af9f260a557 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1132,6 +1132,8 @@ sub tllog {
my ($imp, @rest) = @_;
if (defined($::LOGFILE)) {
_tllog($::LOGLEVELFILE,$::LOGFILE,$imp,@rest);
+ } else {
+ _tllog($::LOGLEVELFILE,\@::LOGLINES,$imp,@rest);
}
my $stderr = \*STDERR;
_tllog($::LOGLEVELTERMINAL,$stderr,$imp,@rest);
@@ -1140,7 +1142,12 @@ sub tllog {
sub _tllog {
my ($threshold,$output,$imp, @rest) = @_;
if ($imp <= $threshold) {
- print $output "@rest";
+ if (ref($output) eq "GLOB") {
+ # we are writing to a file handle
+ print $output "@rest";
+ } else {
+ push @{$output}, "@rest";
+ }
}
}