From 22af6da400a60741273c822dfd129a086f199d9f Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 17 Apr 2021 17:05:35 +0900 Subject: fmtutil: support --dry-run --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 2823ee3b487..6b842e04e36 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -60,6 +60,8 @@ my $sep = (win32() ? ';' : ':'); 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 @@ our @cmdline_options = ( # in same order as help message "refresh", "strict!", "quiet|silent|q", + "dry-run=n", "catcfg", "dolinks", "force", @@ -214,6 +217,8 @@ sub main { } } } + + $DRYRUN = "echo " if ($opts{'dry-run'}); # these two functions should go to TLUtils (for use in updmap) ($texmfconfig, $texmfvar) = @@ -252,7 +257,7 @@ sub main { 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 @@ sub rebuild_one_format { # 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 @@ Options: --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) -- cgit v1.2.3