texlive[60057] Master/texmf-dist/scripts/texlive/fmtutil.pl: no need

commits+karl at tug.org commits+karl at tug.org
Sun Jul 25 20:09:03 CEST 2021


Revision: 60057
          http://tug.org/svn/texlive?view=revision&revision=60057
Author:   karl
Date:     2021-07-25 20:09:03 +0200 (Sun, 25 Jul 2021)
Log Message:
-----------
no need for extra block just for $texpool declaration?

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	2021-07-25 18:05:31 UTC (rev 60056)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2021-07-25 18:09:03 UTC (rev 60057)
@@ -774,55 +774,54 @@
                   . "$prgswitch $texargs";
   print_verbose("running \`$cmdline' ...\n");
 
-  {
-    my $texpool = $ENV{'TEXPOOL'};
-    if ($localpool) {
-      $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : "");
-    }
+  my $texpool = $ENV{'TEXPOOL'};
+  if ($localpool) {
+    $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : "");
+  }
 
-    # in mktexfmtMode we must redirect *all* output to stderr
-    $cmdline .= " >&2" if $mktexfmtMode;
-    $cmdline .= " <$nul";
-    my $retval = system("$DRYRUN$cmdline");
-    
-    # report error if it failed.
-    if ($retval != 0) {
-      $retval /= 256 if ($retval > 0);
-      print_deferred_error("running \`$cmdline' return status: $retval\n");
-    }
+  # in mktexfmtMode we must redirect *all* output to stderr
+  $cmdline .= " >&2" if $mktexfmtMode;
+  $cmdline .= " <$nul";
+  my $retval = system("$DRYRUN$cmdline");
 
-    # Copy the log file after the program is run, so that the log file
-    # is available to inspect even on failure. So we need the dest dir tree.
-    TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"};
-    #
+  # report error if it failed.
+  if ($retval != 0) {
+    $retval /= 256 if ($retval > 0);
+    print_deferred_error("running \`$cmdline' return status: $retval\n");
+  }
+
+  # Copy the log file after the program is run, so that the log file
+  # is available to inspect even on failure. So we need the dest dir tree.
+  TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"};
+  #
+  if ($opts{"dry-run"}) {
+    print_info("would copy log file to: $destdir/$logfile\n");
+  } else {
     # Here and in the following we use copy instead of move
     # to make sure that in SElinux enabled cases the rules of
     # the destination directory are applied.
     # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900580
-    if ($opts{"dry-run"}) {
-      print_info("would copy log file to: $destdir/$logfile\n");
+    # 
+    if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
+      print_info("log file copied to: $destdir/$logfile\n");
     } else {
-      if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
-        print_info("log file copied to: $destdir/$logfile\n");
-      } else {
-        print_deferred_error("failed to copy log $logfile to: $destdir\n");
-      }
+      print_deferred_error("failed to copy log $logfile to: $destdir\n");
     }
+  }
 
-    # original shell script did *not* check the return value
-    # we keep this behavior, but add an option --strict that
-    # errors out on all failures.
-    if ($retval != 0 && $opts{'strict'}) {
-      print_deferred_error("returning error due to option --strict\n");
-      return $FMT_FAILURE;
-    }
+  # original shell script did *not* check the return value
+  # we keep this behavior, but add an option --strict that
+  # errors out on all failures.
+  if ($retval != 0 && $opts{'strict'}) {
+    print_deferred_error("returning error due to option --strict\n");
+    return $FMT_FAILURE;
+  }
 
-    if ($localpool) {
-      if ($texpool) {
-        $ENV{'TEXPOOL'} = $texpool;
-      } else {
-        delete $ENV{'TEXPOOL'};
-      }
+  if ($localpool) {
+    if ($texpool) {
+      $ENV{'TEXPOOL'} = $texpool;
+    } else {
+      delete $ENV{'TEXPOOL'};
     }
   }
 



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