summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2021-04-12 01:00:22 +0000
committerNorbert Preining <preining@logic.at>2021-04-12 01:00:22 +0000
commitb6197233032f59a593310e53222eb6a112b9d032 (patch)
tree5f83ed2d0f0c00a023f12f8904516ff3e1305ffd /Master
parent36fef496a1ab5e10fe21ce399e5f9dbcf5845940 (diff)
fmtutil: make --refresh an option usable with other format selection commands
git-svn-id: svn://tug.org/texlive/trunk@58847 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl27
1 files changed, 19 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl
index b1cc847e81e..2823ee3b487 100755
--- a/Master/texmf-dist/scripts/texlive/fmtutil.pl
+++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl
@@ -3,7 +3,7 @@
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
-# Copyright 2014-2020 Norbert Preining
+# Copyright 2014-2021 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
@@ -103,7 +103,6 @@ our %opts = ( quiet => 0 , strict => 1 );
my @cmdline_cmds = ( # in same order as help message
"all",
"missing",
- "refresh",
"byengine=s",
"byfmt=s",
"byhyphen=s",
@@ -123,6 +122,7 @@ our @cmdline_options = ( # in same order as help message
"no-error-if-no-format",
"nohash",
"recorder",
+ "refresh",
"strict!",
"quiet|silent|q",
"catcfg",
@@ -202,8 +202,16 @@ sub main {
. "Try $prg --help if you need it.\n");
return 1;
} elsif (@cmds == 0) {
- print_error("no command specified; try $prg --help if you need it.\n");
- return 1;
+ if ($opts{'refresh'}) {
+ # backward compatibility: till 2021 we had --refresh as a command
+ # but now we allow combining it with --byfmt etc
+ # In case that --refresh was given without any other command, we
+ # treat it as --all --refresh as it was the case till the change.
+ $opts{'all'} = 1;
+ } else {
+ print_error("no command specified; try $prg --help if you need it.\n");
+ return 1;
+ }
}
}
@@ -288,9 +296,6 @@ sub main {
} elsif ($opts{'byhyphen'}) {
return callback_build_formats('byhyphen', $opts{'byhyphen'});
- } elsif ($opts{'refresh'}) {
- return callback_build_formats('refresh');
-
} elsif ($opts{'missing'}) {
return callback_build_formats('missing');
@@ -473,6 +478,12 @@ sub select_and_rebuild_format {
$doit = 1 if ($what eq 'missing' && ! -r "$destdir/$fmtfile");
$doit = 1 if ($what eq 'byengine' && $eng eq $whatarg);
$doit = 1 if ($what eq 'byfmt' && $fmt eq $whatarg);
+ #
+ # Deal with the --refresh option
+ # 2021 changed behavior that --refresh can be used with all other format
+ # selection cmd line args.
+ $doit = 0 if ($opts{'refresh'} && ! -r "$destdir/$fmtfile");
+ #
# TODO
# original fmtutil.sh was stricter about existence of the hyphen file
# not sure how we proceed here; let's implicitly ignore.
@@ -1338,6 +1349,7 @@ Options:
--no-strict exit successfully even if a format fails to build
--nohash don't update ls-R files
--recorder pass the -recorder option and save .fls files
+ --refresh recreate only existing format files
--quiet be silent
--catcfg (does nothing, exists for compatibility)
--dolinks (does nothing, exists for compatibility)
@@ -1347,7 +1359,6 @@ Options:
Commands:
--all recreate all format files
--missing create all missing format files
- --refresh recreate only existing format files
--byengine ENGINE (re)create formats built with ENGINE
--byfmt FORMAT (re)create format FORMAT
--byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE