[tex-k] Difficulties with texmfvar feature

Ralf Stubner ralf.stubner at web.de
Thu May 25 17:21:51 CEST 2006


Hi,

on the Debian TeX list we have considered using the 'texmfvar' feature
instead of the 'varfonts' feature for the mktex* scripts. We have
encountered a problem with mktexnam, though. Specifically, mktexnam uses

     ${MT_TEXMFVAR=`kpsewhich --expand-path='$TEXMFVAR'`}

when the texmfvar feature is used. Unfortunately, this returns nothing,
if directory specified in TEXMFVAR does not exist yet. IMO it would be
better to use  

     ${MT_TEXMFVAR=`kpsewhich --var-value=TEXMFVAR`}

which returns the value that has been defined in texm.cnf (or in the
environment). In addition, IMO mktexnam should try to create TEXMFVAR if
it does not exist yet, similar to updmap's behaviour. I am attaching a
patch against 

     mktexnam $Id: mktexnam,v 1.30 2004/12/28 20:55:56 olaf Exp $
     kpathsea version 3.5.4

as distributed with teTeX 3.0. Comments?

cheerio
ralf




-------------- next part --------------
*** tetex-bin/texk/kpathsea/mktexnam	2005-10-06 17:26:12.000000000 +0200
--- mktexnam	2006-05-25 12:23:17.000000000 +0200
***************
*** 145,151 ****
        # Some additional uglyness handles the case where $TEXMFVAR exists
        # but $TEXMFVAR/fonts doesn't (yet).
        if test "x$USE_TEXMFVAR" = x1; then
!         : ${MT_TEXMFVAR=`kpsewhich --expand-path='$TEXMFVAR'`}
          MT_DESTROOT=$MT_TEXMFVAR/fonts
          if test -z "$MT_TEXMFVAR"; then
            # Path expansion of $TEXMFVAR was empty.
--- 145,151 ----
        # Some additional uglyness handles the case where $TEXMFVAR exists
        # but $TEXMFVAR/fonts doesn't (yet).
        if test "x$USE_TEXMFVAR" = x1; then
!         : ${MT_TEXMFVAR=`kpsewhich --var-value=TEXMFVAR`}
          MT_DESTROOT=$MT_TEXMFVAR/fonts
          if test -z "$MT_TEXMFVAR"; then
            # Path expansion of $TEXMFVAR was empty.
***************
*** 158,166 ****
            # De we have write access and permission?
            kpseaccess -w "$MT_TEXMFVAR" || FALLBACK=1
            test -w "$MT_TEXMFVAR" || FALLBACK=1
!         else
            # TEXMFVAR defined and exists, but it is not a directory?
            FALLBACK=1
          fi
        else
          # Do we have write access and permission?
--- 158,169 ----
            # De we have write access and permission?
            kpseaccess -w "$MT_TEXMFVAR" || FALLBACK=1
            test -w "$MT_TEXMFVAR" || FALLBACK=1
!         elif test -e "$MT_TEXMFVAR"; then
            # TEXMFVAR defined and exists, but it is not a directory?
            FALLBACK=1
+         else
+           # TEXMFVAR defined but does not exist, try to create it
+           MT_FEATURES=none "$MT_TEXMFMAIN/web2c/mktexdir" "$MT_TEXMFVAR" || FALLBACK=1
          fi
        else
          # Do we have write access and permission?


More information about the tex-k mailing list