diff options
author | Norbert Preining <preining@logic.at> | 2021-04-22 00:44:59 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2021-04-22 00:44:59 +0000 |
commit | 0afb62fa90001586852e8c8264a8159ed0539218 (patch) | |
tree | bc1a7b3d90f4b70aee180e4564953a1c769b9c30 /Master | |
parent | 72ab0ce81ad3898fdc39ea204928c0ff63bc8c64 (diff) |
fmtutil: support --dry-run
git-svn-id: svn://tug.org/texlive/trunk@58951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 10 |
1 files 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) |