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

commits+preining at tug.org commits+preining at tug.org
Thu Apr 22 02:44:59 CEST 2021


Revision: 58951
          http://tug.org/svn/texlive?view=revision&revision=58951
Author:   preining
Date:     2021-04-22 02:44:59 +0200 (Thu, 22 Apr 2021)
Log Message:
-----------
fmtutil: support --dry-run

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-04-22 00:44:52 UTC (rev 58950)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2021-04-22 00:44:59 UTC (rev 58951)
@@ -60,6 +60,8 @@
 my @deferred_stderr;
 my @deferred_stdout;
 
+my $DRYRUN = "";
+
 (our $prg = basename($0)) =~ s/\.pl$//;
 
 # make sure that the main binary path is available at the front
@@ -125,6 +127,7 @@
   "refresh",
   "strict!",
   "quiet|silent|q",
+  "dry-run=n",
   "catcfg",
   "dolinks",
   "force",
@@ -214,6 +217,8 @@
       }
     }
   }
+
+  $DRYRUN = "echo " if ($opts{'dry-run'});
   
   # these two functions should go to TLUtils (for use in updmap)
   ($texmfconfig, $texmfvar) = 
@@ -252,7 +257,7 @@
       touch($bakFile);
       touch($changes_config_file);
     }
-    system($editor, $changes_config_file);
+    system("$DRYRUN$editor", $changes_config_file);
     $changed = files_are_different($bakFile, $changes_config_file);
 
   } elsif ($opts{'showhyphen'}) {
@@ -679,7 +684,7 @@
     # in mktexfmtMode we must redirect *all* output to stderr
     $cmdline .= " >&2" if $mktexfmtMode;
     $cmdline .= " <$nul";
-    my $retval = system($cmdline);
+    my $retval = system("$DRYRUN$cmdline");
     
     # report error if it failed.
     if ($retval != 0) {
@@ -1351,6 +1356,7 @@
   --recorder              pass the -recorder option and save .fls files
   --refresh               recreate only existing format files
   --quiet                 be silent
+  --dry-run | -n          don't actually build formts
   --catcfg                (does nothing, exists for compatibility)
   --dolinks               (does nothing, exists for compatibility)
   --force                 (does nothing, exists for compatibility)



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