texlive[58947] Master/tlpkg/TeXLive/TLUtils.pm: fmtutil/mktexfmt:
commits+preining at tug.org
commits+preining at tug.org
Thu Apr 22 02:44:25 CEST 2021
Revision: 58947
http://tug.org/svn/texlive?view=revision&revision=58947
Author: preining
Date: 2021-04-22 02:44:24 +0200 (Thu, 22 Apr 2021)
Log Message:
-----------
fmtutil/mktexfmt: switch to texmfsysvar if writable
Modified Paths:
--------------
trunk/Master/tlpkg/TeXLive/TLUtils.pm
Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm 2021-04-21 23:48:40 UTC (rev 58946)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm 2021-04-22 00:44:24 UTC (rev 58947)
@@ -4582,6 +4582,21 @@
} elsif ($optsref->{'user'}) {
$texmfconfig = $TEXMFCONFIG;
$texmfvar = $TEXMFVAR;
+ # for fmtutil we try to use TEXMFSYSVAR if it is writable since
+ # stray formats are some of the biggest problems reported
+ if ($prg eq "fmtutil" || $prg eq "mktexfmt") {
+ my $switchit = 0;
+ if (-d "$TEXMFSYSVAR/web2c") {
+ $switchit = 1 if (-w "$TEXMFSYSVAR/web2c");
+ } elsif (-d $TEXMFSYSVAR && -w $TEXMFSYSVAR) {
+ $switchit = 1;
+ }
+ if ($switchit) {
+ # inform about switch, but not for mktexfmt which expects output to be only the format
+ $prg eq "mktexfmt" || info("$prg: using TEXMFSYSVAR instead of TEXMFVAR since it is writable!\n");
+ $texmfvar = $TEXMFSYSVAR;
+ }
+ }
} else {
print STDERR "" .
"$prg [ERROR]: Either -sys or -user mode is required.\n" .
More information about the tex-live-commits
mailing list.