summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2020-01-06 23:55:32 +0000
committerNorbert Preining <preining@logic.at>2020-01-06 23:55:32 +0000
commitbd7d16c081cc6b91edbb1c4ee50754936a5b55e4 (patch)
tree677e912c21fc4d0791e78dc815b688613d58fd82 /Master
parent48cd5522e216e9cea9c8002533b87f9cc4555d7a (diff)
fmtutil --cnffile: search via kpsewhich on dir-less files
git-svn-id: svn://tug.org/texlive/trunk@53340 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl19
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.