From 6cdf512d66cc591a9d98d256223a4f3ccf2b6d1b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 18 Apr 2021 11:02:54 +0900 Subject: tlmgr: report failed/successfull format builds. --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 50 ++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index fc23f21a495..a8873b39acf 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -836,7 +836,7 @@ sub do_cmd_and_check { # and show it to the user before the possibly long delay. info("running $cmd ...\n"); logcommand("running $cmd"); - logpackage("running $cmd"); + logpackage("command: $cmd"); my ($out, $ret); if ($opts{"dry-run"}) { $ret = $F_OK; @@ -877,7 +877,9 @@ sub handle_execute_actions { my $sysmode = ($opts{"usermode"} ? "-user" : "-sys"); my $fmtutil_cmd = "fmtutil$sysmode"; - my $fmtutil_args = $common_fmtutil_args; + my $status_file = TeXLive::TLUtils::tl_tmpfile(); + my $fmtutil_args = "$common_fmtutil_args --status-file $status_file"; + # if create_formats is false (NOT the default) we add --refresh so that # only existing formats are recreated @@ -984,6 +986,8 @@ sub handle_execute_actions { debug ("updating formats based on $e\n"); $errors += do_cmd_and_check ("$fmtutil_cmd --byengine $e --no-error-if-no-format $fmtutil_args"); + read_and_report_fmtutil_status_file($status_file); + unlink($status_file); } # now rebuild all other formats for my $f (keys %do_enable) { @@ -992,6 +996,8 @@ sub handle_execute_actions { next if !$::execute_actions{'enable'}{'formats'}{$f}{'mode'}; debug ("(re)creating format dump $f\n"); $errors += do_cmd_and_check ("$fmtutil_cmd --byfmt $f $fmtutil_args"); + read_and_report_fmtutil_status_file($status_file); + unlink($status_file); $done_formats{$f} = 1; } } @@ -1011,6 +1017,8 @@ sub handle_execute_actions { } if (!$::regenerate_all_formats) { $errors += do_cmd_and_check ("$fmtutil_cmd --byhyphen \"$lang\" $fmtutil_args"); + read_and_report_fmtutil_status_file($status_file); + unlink($status_file); } } } @@ -1021,6 +1029,8 @@ sub handle_execute_actions { info("Regenerating existing formats, this may take some time ..."); # --refresh might already be in $invoke_fmtutil, but we don't care $errors += do_cmd_and_check("$fmtutil_cmd --refresh --all $fmtutil_args"); + read_and_report_fmtutil_status_file($status_file); + unlink($status_file); info("done\n"); $::regenerate_all_formats = 0; } @@ -1038,6 +1048,42 @@ sub handle_execute_actions { } } +sub read_and_report_fmtutil_status_file { + my $status_file = shift; + my $fh; + if (!open($fh, '<', $status_file)) { + printf STDERR "Cannot read status file $status_file, strange!\n"; + return; + } + chomp(my @lines = <$fh>); + close $fh; + my @failed; + my @success; + for my $l (@lines) { + my ($status, $fmt, $eng, $what, $whatargs) = split(' ', $l, 5); + if ($status eq "DISABLED") { + # ignore for now + } elsif ($status eq "NOTSELECTED") { + # ignore for now + } elsif ($status eq "FAILURE") { + push @failed, "$fmt/$eng"; + } elsif ($status eq "SUCCESS") { + push @success, "$fmt/$eng"; + } elsif ($status eq "NOTAVAIL") { + # ignore for now + } elsif ($status eq "UNKNOWN") { + # ignore for now + } else { + # ignore for now + } + } + logpackage(" OK: @success\n") if (@success); + logpackage(" ERROR: @failed\n") if (@failed); + logcommand(" OK: @success\n") if (@success); + logcommand(" ERROR: @failed\n") if (@failed); + info(" OK: @success\n") if (@success); + info(" ERROR: @failed\n") if (@failed); +} # GET_MIRROR # -- cgit v1.2.3