summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-17 15:08:58 +0900
committerNorbert Preining <norbert@preining.info>2020-10-17 15:08:58 +0900
commitb41c0b8dd34249d305837ca8a16ef40512a4474d (patch)
treea59305bb785b1420d9d92fd451e6803cc955a15c
parent4fb633bbfdd2c22d88f14df6584f0ab33b2e4994 (diff)
preliminary work on hybrid mode fmtutil, currently brokendev/hybrid-fmtutil
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl20
1 files 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");
}