From b41c0b8dd34249d305837ca8a16ef40512a4474d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 17 Oct 2020 15:08:58 +0900 Subject: preliminary work on hybrid mode fmtutil, currently broken --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index dab304429b3..7251dd8c03f 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -364,7 +364,17 @@ sub callback_build_formats { $tmpdir = File::Temp::tempdir(CLEANUP => 1); } # set up destination directory - $opts{'fmtdir'} ||= "$texmfvar/web2c"; + if ($mktexfmtMode && -w $TEXMFSYSVAR) { + # if TEXMFSYSVAR is writable and the format to be rebuild is + # defined in a system wide fmtutil.cnf, then try to write + # to TEXMFSYSVAR, otherwise to TEXMFVAR + # check the origin of $opts{'byfmt'}, there can only one argument + # and the format extension is already removed! + + + } else { + $opts{'fmtdir'} ||= "$texmfvar/web2c"; + } TeXLive::TLUtils::mkdirhier($opts{'fmtdir'}) if (! -d $opts{'fmtdir'}); if (! -w $opts{'fmtdir'}) { print_error("format directory not writable: $opts{fmtdir}\n"); @@ -541,10 +551,14 @@ sub compute_format_destination { # strip final -dev from enginedir to support engines like luatex-dev $enginedir =~ s/-dev$//; } + # + # check whether fmt/eng are defined by user fmtutil.cnf or system fmtutil.cnf + # TODO + my $fmtbase = $opts{'hybrid'} ? $opts{'sysfmtdir'} : $opts{'fmtdir'}; if ($opts{'no-engine-subdir'}) { - $destdir = $opts{'fmtdir'}; + $destdir = $fmtbase; } else { - $destdir = "$opts{'fmtdir'}/$enginedir"; + $destdir = "$fmtbase/$enginedir"; } return($kpsefmt, $destdir, $fmtfile, "$fmt.log"); } -- cgit v1.2.3