texlive[56682] Master/texmf-dist/scripts/texlive/fmtutil.pl: remove

commits+preining at tug.org commits+preining at tug.org
Sat Oct 17 08:08:29 CEST 2020


Revision: 56682
          http://tug.org/svn/texlive?view=revision&revision=56682
Author:   preining
Date:     2020-10-17 08:08:28 +0200 (Sat, 17 Oct 2020)
Log Message:
-----------
remove duplicated code in fmtutil

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

Modified: trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2020-10-16 23:53:58 UTC (rev 56681)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2020-10-17 06:08:28 UTC (rev 56682)
@@ -407,34 +407,23 @@
   my $nobuild = 0;
   my $notavail = 0;
   my $total = 0;
-  for my $fmt (keys %{$alldata->{'merged'}}) {
-    for my $eng (keys %{$alldata->{'merged'}{$fmt}}) {
-      next if ($fmt ne $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"); }
+  for my $swi (qw/format=engine format!=engine/) {
+    for my $fmt (keys %{$alldata->{'merged'}}) {
+      for my $eng (keys %{$alldata->{'merged'}{$fmt}}) {
+        next if ($swi eq "format=engine" && $fmt ne $eng);
+        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"); }
+      }
     }
   }
-  for my $fmt (keys %{$alldata->{'merged'}}) {
-    for my $eng (keys %{$alldata->{'merged'}{$fmt}}) {
-      next if ($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 2): unknown return "
-             . "from select_and_rebuild.\n"); }
-    }
-  }
 
   # if the user asked to rebuild something, but we did nothing, report
   # unless we tried to rebuild only missing formats.



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