From 58e3c071fae0e33200c1b91bb9f8baf10c6eb280 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 22 Apr 2021 00:44:24 +0000 Subject: fmtutil/mktexfmt: switch to texmfsysvar if writable git-svn-id: svn://tug.org/texlive/trunk@58947 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 786c35813cc..63d2dd65440 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -4582,6 +4582,21 @@ sub setup_sys_user_mode { } 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" . -- cgit v1.2.3