From bd7d16c081cc6b91edbb1c4ee50754936a5b55e4 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 6 Jan 2020 23:55:32 +0000 Subject: fmtutil --cnffile: search via kpsewhich on dir-less files git-svn-id: svn://tug.org/texlive/trunk@53340 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/scripts/texlive') 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. -- cgit v1.2.3