fmtutil-sys: finding a user cnf-file

Norbert Preining preining at logic.at
Mon Jan 6 15:12:06 CET 2020


Dear Ulrike,

> fmtutil-sys --cnffile=fmtutil-dev.cnf --all

This is not supported at the moment. Options passed via --cnffile need
to be fully specified paths for now.

But it sounds reasonable to support this, Karl, WDYT?

Ulrike, here is a patch for testing, it searches arguments passed via
--cnffile if they are not found directly, and not containing directories
(so only xxx.cnf, but not a/b.cnf).

Applies to texmf-dist/scripts/texlive/fmtutil.pl

--- fmtutil.pl.orig	2020-01-06 22:52:23.133086688 +0900
+++ fmtutil.pl	2020-01-06 23:08:55.703459866 +0900
@@ -1040,7 +1040,18 @@
     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);
     }


Best

Norbert

--
PREINING Norbert                               http://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tex-live mailing list