texlive[58954] Master/texmf-dist/scripts/texlive/tlmgr.pl: tlmgr:

commits+preining at tug.org commits+preining at tug.org
Thu Apr 22 02:45:19 CEST 2021


Revision: 58954
          http://tug.org/svn/texlive?view=revision&revision=58954
Author:   preining
Date:     2021-04-22 02:45:19 +0200 (Thu, 22 Apr 2021)
Log Message:
-----------
tlmgr: report failed/successfull format builds.

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2021-04-22 00:45:12 UTC (rev 58953)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2021-04-22 00:45:19 UTC (rev 58954)
@@ -836,7 +836,7 @@
   # 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,8 +877,10 @@
 
   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";
 
+
   # of create_formats is unset (NOT the default) we add --refresh so that
   # only existing formats are recreated
   if (!$localtlpdb->option("create_formats")) {
@@ -984,6 +986,8 @@
         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 @@
         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 @@
         }
         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 @@
       info("Regenerating available formats, this may take some time ...");
       # --refresh might already be in $fmtutil_args, but we don't care
       $errors += do_cmd_and_check("$fmtutil_cmd --all --refresh $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 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
 #



More information about the tex-live-commits mailing list.