[Debian-tex-commits] SVN tex-common commit + diffs: r4257 - tex-common/branches/for-tl2008/debian

Norbert Preining preining at alioth.debian.org
Mon Oct 5 09:25:13 UTC 2009


Author: preining
Date: 2009-10-05 09:25:10 +0000 (Mon, 05 Oct 2009)
New Revision: 4257

Modified:
   tex-common/branches/for-tl2008/debian/postinst.in
Log:
protect the fmtutil-sys, kpsewhich calls in do_triggers with checks for
their existence


Modified: tex-common/branches/for-tl2008/debian/postinst.in
===================================================================
--- tex-common/branches/for-tl2008/debian/postinst.in	2009-10-05 07:56:17 UTC (rev 4256)
+++ tex-common/branches/for-tl2008/debian/postinst.in	2009-10-05 09:25:10 UTC (rev 4257)
@@ -146,23 +146,26 @@
     # postinst will often be called for several triggers at once.
     case " $trigger " in
         *" texmf-hyphen "*) 
-         # code from postinst.tex
-            v=$(kpsewhich -var-value TEXMFSYSVAR)
-            c=$(kpsewhich -var-value TEXMFSYSCONFIG)
-            TEXMFVAR="$v"
-            TEXMFCONFIG="$c"
-            export TEXMFVAR TEXMFCONFIG
-            fmtcnffile=$(kpsewhich --format='web2c files' fmtutil.cnf)
-            X=$(grep "^[[:space:]]*latex[[:space:]]" $fmtcnffile || true)
-            if [ -n "$X" ] ; then
-                # latex is installed so we can actually try to recreate
-                # formats based on language.dat
-                tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
-                printf "Building formats --byhyphen $(kpsewhich language.dat).\n\tThis may take some time... "
-                if fmtutil-sys --byhyphen "$(kpsewhich language.dat)" > $tempfile 2>&1 ; then
+          if dhit_libkpathsea_configured; then
+            if which kpsewhich >/dev/null; then
+              if which fmtutil-sys >/dev/null; then
+                # code from postinst.tex
+                v=$(kpsewhich -var-value TEXMFSYSVAR)
+                c=$(kpsewhich -var-value TEXMFSYSCONFIG)
+                TEXMFVAR="$v"
+                TEXMFCONFIG="$c"
+                export TEXMFVAR TEXMFCONFIG
+                fmtcnffile=$(kpsewhich --format='web2c files' fmtutil.cnf)
+                X=$(grep "^[[:space:]]*latex[[:space:]]" $fmtcnffile || true)
+                if [ -n "$X" ] ; then
+                  # latex is installed so we can actually try to recreate
+                  # formats based on language.dat
+                  tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
+                  printf "Building formats --byhyphen $(kpsewhich language.dat).\n\tThis may take some time... "
+                  if fmtutil-sys --byhyphen "$(kpsewhich language.dat)" > $tempfile 2>&1 ; then
                     rm -f $tempfile
                     echo "done."
-                else
+                  else
                     exec >&2
                     echo
                     echo "fmtutil-sys failed. Output has been stored in"
@@ -170,8 +173,11 @@
                     echo "Please include this file if you report a bug."
                     echo
                     exit 1
+                  fi
                 fi
+              fi
             fi
+          fi
         ;;
     esac
 }




More information about the Debian-tex-commits mailing list