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

Norbert Preining preining at alioth.debian.org
Sat Oct 3 16:19:31 UTC 2009


Author: preining
Date: 2009-10-03 16:19:31 +0000 (Sat, 03 Oct 2009)
New Revision: 4235

Modified:
   tex-common/branches/for-tl2008/debian/postinst.in
   tex-common/branches/for-tl2008/scripts/postinst-tex
Log:
fixes for lsr triggers


Modified: tex-common/branches/for-tl2008/debian/postinst.in
===================================================================
--- tex-common/branches/for-tl2008/debian/postinst.in	2009-10-03 16:04:35 UTC (rev 4234)
+++ tex-common/branches/for-tl2008/debian/postinst.in	2009-10-03 16:19:31 UTC (rev 4235)
@@ -7,6 +7,9 @@
 #include variables
 <:=@COPYRIGHT:>//
 
+TEXMFTREES="/usr/share/texmf /var/lib/texmf"
+FULLTEXMFTREES="$TEXMFTREES /usr/share/texmf-texlive"
+
 ## Define static variables we need
 UCF_FILES="<:=$TEX_COMMON_UCF_FILES:>"
 TEXMFSYSVARDIR="<:=$TEXMFSYSVARDIR:>"
@@ -34,6 +37,7 @@
 
 do_triggers() 
 {
+    DONE_FULL_LSR=0
     # currently we only support only triggers for updmap.d and
     # language.d changes
     # because all the other calls are quite fast 
@@ -48,11 +52,42 @@
     #
     # the following triggers are reacted upon and in that order:
     # - texmf-lsr: call mktexlsr if present
+    # - texmf-lsrfull: call mktexlsr if present
     # - texmf-map: call updmap-sys
     # - texmf-hyphen: if texmf-format hasn't been triggered call 
     #                 fmtutil-sys --byhyphen ...
     case " $trigger " in
+        *" texmf-lsrfull "*)
+            # code from postinst-tex
+            if dhit_libkpathsea_configured; then
+                # mktexlsr may not be present
+                if which mktexlsr >/dev/null; then
+                    tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
+                    printf "Running mktexlsr. This may take some time... "
+                    if mktexlsr $FULLTEXMFTREES > $tempfile 2>&1 ; then
+                        DONE_FULL_LSR=1
+                        rm -f $tempfile
+                        echo "done."
+                    else
+                        exec >&2
+                        echo
+                        echo "mktexlsr $FULLTEXMFTREES failed. Output has been stored in"
+                        echo "$tempfile"
+                        echo "Please include this file if you report a bug."
+                        echo
+                        exit 1
+                    fi
+                fi
+            fi
+        ;;
+    esac
+    # do NOT merge these two cases into one, from dpkg's trigger.txt:
+    # Generally each trigger name should be tested for separately, as the
+    # postinst will often be called for several triggers at once.
+    case " $trigger " in
         *" texmf-lsr "*)
+          # only to lsr if we haven't done lsrfull
+          if [ $DONE_FULL_LSR = 0 ] ; then
             # code from postinst-tex
             if dhit_libkpathsea_configured; then
                 # mktexlsr may not be present
@@ -73,6 +108,7 @@
                     fi
                 fi
             fi
+          fi
         ;;
     esac
     # do NOT merge these two cases into one, from dpkg's trigger.txt:

Modified: tex-common/branches/for-tl2008/scripts/postinst-tex
===================================================================
--- tex-common/branches/for-tl2008/scripts/postinst-tex	2009-10-03 16:04:35 UTC (rev 4234)
+++ tex-common/branches/for-tl2008/scripts/postinst-tex	2009-10-03 16:19:31 UTC (rev 4235)
@@ -14,6 +14,8 @@
 # So please be careful if you add stuff here!
 #
 
+TEXMFTREES="/usr/share/texmf /var/lib/texmf"
+FULLTEXMFTREES="$TEXMFTREES /usr/share/texmf-texlive"
 
 # Tell if kpsewhich works. If this is the case:
 #
@@ -29,13 +31,13 @@
 {
     tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
     printf "Running mktexlsr. This may take some time... "
-    if mktexlsr #TEXMFTREES# > $tempfile 2>&1 ; then
+    if mktexlsr $* > $tempfile 2>&1 ; then
         rm -f $tempfile
         echo "done."
     else
         exec >&2
         echo
-        echo "mktexlsr failed. Output has been stored in"
+        echo "mktexlsr $* failed. Output has been stored in"
         echo "$tempfile"
         echo "Please include this file if you report a bug."
         echo
@@ -91,6 +93,9 @@
             # the lsr database first
             do_lsr=0
             for i in #WHATTODO# ; do
+                if [ "$i" = lsrfull ] ; then
+                    TEXMFTREES=$FULLTEXMFTREES
+                fi
                 if [ "$i" = allformats ] ; then
                     do_lsr=1
                 fi
@@ -101,12 +106,22 @@
             if [ $do_lsr = 1 ] ; then
                 # mktexlsr may not be present
                 if which mktexlsr >/dev/null; then
-                    dhit_update_lsr_files
+                    dhit_update_lsr_files $TEXMFTREES
                     # can we "close" or "delete" a trigger, i.e. say
                     # that it has been dealt with?
                 fi
             fi
             for i in #WHATTODO# ; do
+                if [ "$i" = lsr ] ; then
+                    if [ $do_lsr = 0 ] ; then
+                        update-texmf-config lsr
+                    fi
+                fi
+                if [ "$i" = lsrfull ] ; then
+                    if [ $do_lsr = 0 ] ; then
+                        update-texmf-config lsrfull
+                    fi
+                fi
                 if [ "$i" = map ] ; then
                     update-texmf-config map
                 fi




More information about the Debian-tex-commits mailing list