diff options
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 5a951527ef6..0ced1ec96a4 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -61,6 +61,7 @@ my @deferred_stderr; my @deferred_stdout; my $DRYRUN = ""; +my $STATUS_FH; (our $prg = basename($0)) =~ s/\.pl$//; @@ -126,6 +127,7 @@ our @cmdline_options = ( # in same order as help message "nohash", "recorder", "refresh", + "status-file=s", "strict!", "quiet|silent|q", "catcfg", @@ -219,6 +221,11 @@ sub main { } $DRYRUN = "echo " if ($opts{'dry-run'}); + + if ($opts{'status-file'}) { + open $STATUS_FH, '>>', $opts{'status-file'} + || printf STDERR "Cannot open status-file: $opts{'status-file'}\nWill not write status information!\n"; + } # these two functions should go to TLUtils (for use in updmap) ($texmfconfig, $texmfvar) = @@ -316,6 +323,10 @@ sub main { return 1; } + if ($STATUS_FH) { + close($STATUS_FH) || print STDERR "Cannot close fh for $opts{'status-file'}.\n"; + } + unless ($opts{'nohash'}) { # TODO should only do this if built something, e.g., not --listcfg print_info("updating ls-R files\n"); @@ -333,6 +344,12 @@ sub dump_data { print Data::Dumper::Dumper($alldata); } +# +sub log_to_status { + if ($STATUS_FH) { + print $STATUS_FH "@_\n"; + } +} # callback_build_formats - (re)builds the formats as selected, # returns exit status or dies. Exit status is always zero unless @@ -423,13 +440,28 @@ sub callback_build_formats { next if ($swi eq "format!=engine" && $fmt eq $eng); $total++; my $val = select_and_rebuild_format($fmt, $eng, $what, $whatarg); - if ($val == $FMT_DISABLED) { $disabled++; } - elsif ($val == $FMT_NOTSELECTED) { $nobuild++; } - elsif ($val == $FMT_FAILURE) { $err++; push (@err, "$eng/$fmt"); } - elsif ($val == $FMT_SUCCESS) { $suc++; } - elsif ($val == $FMT_NOTAVAIL) { $notavail++; } - else { print_error("callback_build_format (round 1): unknown return " - . "from select_and_rebuild.\n"); } + if ($val == $FMT_DISABLED) { + log_to_status("DISABLED", $fmt, $eng, $what, $whatarg); + $disabled++; + } elsif ($val == $FMT_NOTSELECTED) { + log_to_status("NOTSELECTED", $fmt, $eng, $what, $whatarg); + $nobuild++; + } elsif ($val == $FMT_FAILURE) { + log_to_status("FAILURE", $fmt, $eng, $what, $whatarg); + $err++; + push (@err, "$eng/$fmt"); + } elsif ($val == $FMT_SUCCESS) { + log_to_status("SUCCESS", $fmt, $eng, $what, $whatarg); + $suc++; + } elsif ($val == $FMT_NOTAVAIL) { + log_to_status("NOTAVAIL", $fmt, $eng, $what, $whatarg); + $notavail++; + } + else { + log_to_status("UNKNOWN", $fmt, $eng, $what, $whatarg); + print_error("callback_build_format (round 1): unknown return " + . "from select_and_rebuild.\n"); + } } } } @@ -1356,6 +1388,7 @@ Options: --nohash don't update ls-R files --recorder pass the -recorder option and save .fls files --refresh recreate only existing format files + --status-file FILE append status information about built formats to FILE --quiet be silent --catcfg (does nothing, exists for compatibility) --dolinks (does nothing, exists for compatibility) |