diff options
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 65ceee3be5a..4dd097286f1 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -3,7 +3,7 @@ # fmtutil - utility to maintain format files. # (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.) # -# Copyright 2014-2018 Norbert Preining +# Copyright 2014-2020 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # @@ -1040,7 +1040,18 @@ sub determine_config_files { my @tmp; for my $f (@{$opts{'cnffile'}}) { if (! -f $f) { - die "$prg: Config file \"$f\" not found"; + # if $f is a pure file name, that is dirname $f == ".", + # then try to find it via kpsewhich + if (dirname($f) eq ".") { + chomp(my $kpfile = `kpsewhich $f`); + if ($kpfile ne "") { + $f = $kpfile; + } else { + die "$prg: Config file \"$f\" cannot be found via kpsewhich"; + } + } else { + die "$prg: Config file \"$f\" not found"; + } } push @tmp, (win32() ? lc($f) : $f); } @@ -1363,7 +1374,9 @@ Explanation of trees and files normally used: If --cnffile is specified on the command line (possibly multiple times), its value(s) are used. Otherwise, fmtutil reads all the fmtutil.cnf files found by running \`kpsewhich -all fmtutil.cnf', in the - order returned by kpsewhich. + order returned by kpsewhich. Files passed in via --cnffile are + first tried to be loaded directly, and if not found and the file names + don't contain directory parts, are searched via kpsewhich. In any case, if multiple fmtutil.cnf files are found, all the format definitions found in all the fmtutil.cnf files are merged. |