From 4903aa123d920fd77fc29e1ec7a387d758cfec1e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 26 Mar 2021 09:25:59 +0900 Subject: tlmgr format rebuild semantics update if create_formats option is unset, we do not build any new formats but we do recreate existing formats. This uses the new feature of fmtutil that allows pairing of --refresh with other format selection commands like --byfmt etc. --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 1f1ffc91f6d..136b27e395d 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -869,6 +869,13 @@ sub handle_execute_actions { my $sysmode = ($opts{"usermode"} ? "-user" : "-sys"); my $invoke_fmtutil = "fmtutil$sysmode $common_fmtutil_args"; + # of create_formats is unset (NOT the default) we add --refresh so that + # only existing formats are recreated + if (!$localtlpdb->option("create_formats")) { + $invoke_fmtutil .= " --refresh"; + info("only existing formats will be refreshed per user option (create_formats=0)\n"); + } + if ($::files_changed) { $errors += do_cmd_and_check("mktexlsr"); if (defined($localtlpdb->get_package('context')) @@ -931,9 +938,8 @@ sub handle_execute_actions { } } - # format-regenerate is used when the paper size changes. In that - # case, if option("create_formats") is set, we simply want to generate - # all formats + # format-regenerate is used when the paper size changes. + # In that case we simply want to generate all formats # my %done_formats; my %updated_engines; @@ -957,16 +963,12 @@ sub handle_execute_actions { for my $m (keys %{$::execute_actions{'disable'}{'formats'}}) { $do_full = 1; } - my $opt_fmt = $localtlpdb->option("create_formats"); if ($do_full) { info("regenerating fmtutil.cnf in $TEXMFDIST\n"); TeXLive::TLUtils::create_fmtutil($localtlpdb, "$TEXMFDIST/web2c/fmtutil.cnf"); } - if (!$opt_fmt) { - info("formats not rebuilt per user option (create_formats=0)\n"); - } - if ($opt_fmt && !$::regenerate_all_formats) { + if (!$::regenerate_all_formats) { # first regenerate all formats --byengine for my $e (keys %updated_engines) { debug ("updating formats based on $e\n"); @@ -997,13 +999,13 @@ sub handle_execute_actions { # Use full path for external command, except on Windows. $lang = "$TEXMFSYSVAR/tex/generic/config/$lang"; } - if ($opt_fmt && !$::regenerate_all_formats) { + if (!$::regenerate_all_formats) { $errors += do_cmd_and_check ("$invoke_fmtutil --byhyphen \"$lang\""); } } } - if ($opt_fmt && $::regenerate_all_formats) { + if ($::regenerate_all_formats) { info("Regenerating all formats, this may take some time ..."); $errors += do_cmd_and_check("$invoke_fmtutil --all"); info("done\n"); -- cgit v1.2.3