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

Norbert Preining preining at alioth.debian.org
Sat Oct 3 14:01:20 UTC 2009


Author: preining
Date: 2009-10-03 14:01:17 +0000 (Sat, 03 Oct 2009)
New Revision: 4227

Removed:
   tex-common/branches/for-tl2008/scripts/postinst-texlsr
   tex-common/branches/for-tl2008/scripts/postrm-texlsr
Modified:
   tex-common/branches/for-tl2008/debian/changelog
   tex-common/branches/for-tl2008/debian/postinst.in
   tex-common/branches/for-tl2008/debian/triggers
   tex-common/branches/for-tl2008/scripts/dh_installtex
   tex-common/branches/for-tl2008/scripts/postinst-tex
   tex-common/branches/for-tl2008/scripts/postrm-tex
   tex-common/branches/for-tl2008/scripts/update-texmf-config
   tex-common/branches/for-tl2008/scripts/update-texmf-config.8
Log:
implement trigger support for mktexlsr


Modified: tex-common/branches/for-tl2008/debian/changelog
===================================================================
--- tex-common/branches/for-tl2008/debian/changelog	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/debian/changelog	2009-10-03 14:01:17 UTC (rev 4227)
@@ -14,8 +14,9 @@
     changes possibly cluttering diffs.
   * Add a Conflicts on old texlive-common, in order to force an upgrade of
     all the packages in one bunch.
+  * implement trigger support for mktexlsr
 
- -- Norbert Preining <preining at debian.org>  Sun, 10 May 2009 16:03:38 +0200
+ -- Norbert Preining <preining at debian.org>  Sat, 03 Oct 2009 21:35:22 +0900
 
 tex-common (1.20) unstable; urgency=low
 

Modified: tex-common/branches/for-tl2008/debian/postinst.in
===================================================================
--- tex-common/branches/for-tl2008/debian/postinst.in	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/debian/postinst.in	2009-10-03 14:01:17 UTC (rev 4227)
@@ -45,28 +45,41 @@
     update-updmap --quiet
     update-language
     update-fmtutil
-    # 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 /usr/share/texmf/ /usr/share/texmf-texlive/ /var/lib/texmf/ > $tempfile 2>&1 ; then
-                rm -f $tempfile
-                echo "done."
-            else
-                exec >&2
-                echo
-                echo "mktexlsr failed. Output has been stored in"
-                echo "$tempfile"
-                echo "Please include this file if you report a bug."
-                echo
-                exit 1
+    #
+    # the following triggers are reacted upon and in that order:
+    # - texmf-lsr: 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-lsr "*)
+            # 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 > $tempfile 2>&1 ; then
+                        rm -f $tempfile
+                        echo "done."
+                    else
+                        exec >&2
+                        echo
+                        echo "mktexlsr failed. Output has been stored in"
+                        echo "$tempfile"
+                        echo "Please include this file if you report a bug."
+                        echo
+                        exit 1
+                    fi
+                fi
             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-updmap "*) 
+        *" texmf-map "*) 
          # code from postinst-tex
          if dhit_libkpathsea_configured; then
              if which updmap-sys >/dev/null; then
@@ -96,7 +109,7 @@
     # 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-language "*) 
+        *" texmf-hyphen "*) 
          # code from postinst.tex
             v=$(kpsewhich -var-value TEXMFSYSVAR)
             c=$(kpsewhich -var-value TEXMFSYSCONFIG)
@@ -265,7 +278,7 @@
     # that calls mktexlsr if possible, and update-*
     # we set the triggers updmap.d
     #
-    trigger=texmf-updmap
+    trigger="texmf-lsr texmf-map"
     do_triggers
 
     # now call the equivalent of fmtutil-sys --all explicitely

Modified: tex-common/branches/for-tl2008/debian/triggers
===================================================================
--- tex-common/branches/for-tl2008/debian/triggers	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/debian/triggers	2009-10-03 14:01:17 UTC (rev 4227)
@@ -1,2 +1,3 @@
-interest texmf-language
-interest texmf-updmap
+interest texmf-hyphen
+interest texmf-map
+interest texmf-lsr

Modified: tex-common/branches/for-tl2008/scripts/dh_installtex
===================================================================
--- tex-common/branches/for-tl2008/scripts/dh_installtex	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/dh_installtex	2009-10-03 14:01:17 UTC (rev 4227)
@@ -42,7 +42,6 @@
 [B<hyphenfile=>I<file.cnf>[=I<n>]]
 [B<format=>I<format>,I<engine>,I<hyphenfile>,I<rest args>]
 [B<formatfile=>I<file.cnf>[=I<n>]]
-[B<texmftrees=>I<tree>[,I<tree>]]
 
 =head1 DESCRIPTION
 
@@ -68,20 +67,6 @@
 
 	dh_installtex
 
-The ls-R databases are [B<only>] updated for the following
-trees: /usr/share/texmf and /var/lib/texmf. Normal TeX related packages
-following the Debian TeX Policy should only install files into these 
-directories and /etc/texmf (which does not need a ls-R DB), so this is
-a sensible choice. If you need to rehash the ls-R database of some other
-trees (e.g., because an old version of your package had files in
-/usr/share/texmf-tetex), please specify these additional trees on the
-command line via the texmftrees option:
-
-	dh_installtex texmftrees=tree1,tree2,...
-
-This will update the ls-R databases for /usr/share/texmf, /var/lib/texmf, and
-in addition tree1 and tree2.
-
 =head1 COMPLEX USAGE: Registering fonts, hyphenation patterns and formats
 
 If in addition, you have to install map files, hyphenation patterns for
@@ -244,8 +229,6 @@
 my %cmdlinefilespriority;
 my @cmdlinetexmftrees;
 
-my @defaulttexmftrees = qw,/usr/share/texmf /var/lib/texmf,;
-	
 #
 # definitions for the different flavors
 #
@@ -409,8 +392,6 @@
 		$cmdlinefilespriority{$type}{$fn}=$pr;
 	} elsif (m/^(map|hyphen|format)=(.*)$/) {
 		push @{$cmdlineargs{$1}}, $2;
-	} elsif (m/^texmftrees=(.*)$/) {
-		@cmdlinetexmftrees = split /,/, $1;
 	} else {
 		error("Unrecognized argument: $_\n");
 	}
@@ -647,38 +628,16 @@
 		$dothefullstuff = 1;
 	}
 	if (! $dh{NOSCRIPTS}) {
-		my %uniq;
-		foreach (@cmdlinetexmftrees, @defaulttexmftrees) { 
-			$uniq{$_} = 1; 
-		}
-		my @foo = keys(%uniq);
-		# we should NOT check whether files are actually installed
-		# because we have to update the ls-R db for disappearing files, too.
-		autoscript($package, "postinst", "postinst-texlsr", "s|#TEXMFTREES#|@foo|");
 		if ($dothefullstuff) {
 			autoscript($package, "postinst", "postinst-tex", "s|#FORMATSFILES#|@fmtconffiles|; s|#WHATTODO#|@whattodo|");
-		}
-
-		# postrm stuff
-		# we have to take care for the debhelper compat level. With
-		# debhelper >= 6 the different parts are reverse ordered.
-		if (compat(5)) {
-			# for compat level <= 5 do the texlsr stuff now
-			autoscript($package, "postrm",   "postrm-texlsr", "s|#TEXMFTREES#|@foo|");
-		}
-		if ($dothefullstuff) {
 			# map entries have already been filtered out
 			autoscript($package, "postrm",   "postrm-tex", "s|#FORMATS#|@postrmfmtdata|; s|#WHATTODO#|@whattodo|");
 		}
-		if (!compat(5)) {
-			# for compat level >> 5 do it now
-			autoscript($package, "postrm",   "postrm-texlsr", "s|#TEXMFTREES#|@foo|");
-		}
 	}
 
 	# for trigger support
 	addsubstvar($package, "misc:Depends", "dpkg", ">= 1.14.18");
-	addsubstvar($package, "misc:Depends", "tex-common", ">= 1.18");
+	addsubstvar($package, "misc:Depends", "tex-common", ">= 2.00");
 }
 
 =head1 SEE ALSO

Modified: tex-common/branches/for-tl2008/scripts/postinst-tex
===================================================================
--- tex-common/branches/for-tl2008/scripts/postinst-tex	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/postinst-tex	2009-10-03 14:01:17 UTC (rev 4227)
@@ -1,8 +1,8 @@
 ##
 ## postinst-tex
 ##
-## postinst snippets for registering hyphenation patterns, font maps, 
-## and formats
+## postinst snippets for everything TeX related (mktlsr, hyphenation
+## patterns, formats, font maps)
 ##
 ## Authors:
 ##       Florent Rougon <f.rougon at free.fr>
@@ -14,23 +14,30 @@
 # So please be careful if you add stuff here!
 #
 
-dhit_create_fontmaps ()
+
+# Tell if kpsewhich works. If this is the case:
+#
+#   1. kpsewhich is installed and;
+#
+#   2. libkpathsea is configured.
+dhit_libkpathsea_configured ()
 {
-    tempfile=$(mktemp -p /tmp updmap.XXXXXXXX)
-    printf "Running updmap-sys. This may take some time... "
-    if updmap-sys > $tempfile 2>&1 ; then
+    kpsewhich --version >/dev/null 2>&1
+}
+
+dhit_update_lsr_files ()
+{
+    tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
+    printf "Running mktexlsr. This may take some time... "
+    if mktexlsr #TEXMFTREES# > $tempfile 2>&1 ; then
         rm -f $tempfile
         echo "done."
     else
         exec >&2
         echo
-        echo "updmap-sys 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
-	echo "Sometimes, not accepting conffile updates in /etc/texmf/updmap.d"
-	echo "causes updmap-sys to fail.  Please check for files with extension"
-	echo ".dpkg-dist or .ucf-dist in this directory" 
         echo
         exit 1
     fi
@@ -80,12 +87,28 @@
         # All of the following needs an installed and configured
         # basic TeX system, so check this.
         if dhit_libkpathsea_configured; then
+            # if we are doing something with formats we have to update
+            # the lsr database first
+            do_lsr=0
             for i in #WHATTODO# ; do
+                if [ "$i" = allformats ] ; then
+                    do_lsr=1
+                fi
+                if [ "$i" = format ] ; then
+                    do_lsr=1
+                fi
+            done
+            if [ $do_lsr = 1 ] ; then
+                # mktexlsr may not be present
+                if which mktexlsr >/dev/null; then
+                    dhit_update_lsr_files
+                    # 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" = map ] ; then
-                    update-texmf-config updmap
-                    #if which updmap-sys >/dev/null; then
-                    #   dhit_create_fontmaps
-                    #fi
+                    update-texmf-config map
                 fi
                 if [ "$i" = allformats ] ; then
                     dhit_build_format --all
@@ -96,9 +119,7 @@
                     done
                 fi
                 if [ "$i" = hyphen ] ; then
-                    update-texmf-config language
-                    #dhit_build_hyphen_format_if_format_exists \
-                    #    latex $(kpsewhich language.dat)
+                    update-texmf-config hyphen
                 fi
             done
         fi
@@ -111,4 +132,4 @@
 esac
 
 # Let vim know that we don't want tabs
-# vim:set expandtab: #
+# vim:set expandtab tabstop=4: #

Deleted: tex-common/branches/for-tl2008/scripts/postinst-texlsr
===================================================================
--- tex-common/branches/for-tl2008/scripts/postinst-texlsr	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/postinst-texlsr	2009-10-03 14:01:17 UTC (rev 4227)
@@ -1,70 +0,0 @@
-##
-## postinst-texlsr
-##
-## postinst snippets for calling maketexlsr, update-*
-##
-## Authors:
-##       Florent Rougon <f.rougon at free.fr>
-##       Norbert Preining <preining at logic.at>
-##
-# Please note that comments in this file are stripped before installation
-# by calling a grep -v '^[ \t]*# '
-# Thus, first lines containing ## are preserved!
-# So please be careful if you add stuff here!
-#
-# Let vim know that we don't want tabs
-# vim:set expandtab: #
-
-
-# Tell if kpsewhich works. If this is the case:
-#
-#   1. kpsewhich is installed and;
-#
-#   2. libkpathsea is configured.
-dhit_libkpathsea_configured ()
-{
-    kpsewhich --version >/dev/null 2>&1
-}
-
-dhit_update_lsr_files ()
-{
-    tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
-    printf "Running mktexlsr. This may take some time... "
-    if mktexlsr #TEXMFTREES# > $tempfile 2>&1 ; then
-        rm -f $tempfile
-        echo "done."
-    else
-        exec >&2
-        echo
-        echo "mktexlsr failed. Output has been stored in"
-        echo "$tempfile"
-        echo "Please include this file if you report a bug."
-        echo
-        exit 1
-    fi
-}
-
-case "$1" in
-    configure|abort-upgrade|abort-remove|abort-deconfigure)
-        # These programs are all in tex-common and can be run immediately.
-	# In fact it *does* hurt not calling them since we might
-	# have formats installed and we call with --all, so not the
-	# trigger action is done, but the postinst runs the fmtutil-sys call
-        update-updmap --quiet
-        update-language
-        update-fmtutil
-        # All of the following needs an installed and configured
-        # basic TeX system, so check this.
-        if dhit_libkpathsea_configured; then
-            # mktexlsr may not be present
-            if which mktexlsr >/dev/null; then
-                dhit_update_lsr_files
-            fi
-        fi
-    ;;
-
-    *)
-        echo "postinst called with unknown argument '$1'" >&2
-        exit 1
-    ;;
-esac

Modified: tex-common/branches/for-tl2008/scripts/postrm-tex
===================================================================
--- tex-common/branches/for-tl2008/scripts/postrm-tex	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/postrm-tex	2009-10-03 14:01:17 UTC (rev 4227)
@@ -13,39 +13,7 @@
 # So please be careful if you add stuff here!
 #
 
-dhit_build_format ()
-{
 
-    tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
-    printf "Building format(s) $1 $(basename "$2"). This may take some time..."
-    if fmtutil-sys "$1" "$2" > $tempfile 2>&1 ; then
-        rm -f $tempfile
-        echo " done."
-    else
-        echo
-        echo "fmtutil-sys failed. Output has been stored in"
-        echo "$tempfile"
-        echo "Please include this file if you report a bug."
-        echo
-        exit 1
-    fi
-}
-
-dhit_build_hyphen_format_if_format_exists ()
-{
-    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:]]*$1[[:space:]]" "$fmtcnffile" || true)
-    if [ -n "$X" ] ; then
-        dhit_build_format --byhyphen "$2"
-    fi
-}
-
-
 case "$1" in
     remove|disappear)
         for i in #WHATTODO# ; do
@@ -59,14 +27,11 @@
                 else
                     echo "update-texmf-config not present: is tex-common installed?" >&2
                 fi
-                #dhit_libkpathsea_configured && \
-                #    dhit_check_run_without_errors updmap-sys
             fi
             if [ "$i" = allformats ] ; then
                 for fmt in #FORMATS# ; do
                     rm -f /var/lib/texmf/web2c/$fmt.*
                 done
-                dhit_check_run_without_errors fmtutil-sys --all
             fi
             if [ "$i" = format ] ; then
                 for fmt in #FORMATS# ; do
@@ -79,11 +44,6 @@
                 else
                     echo "update-texmf-config not present: is tex-common installed?" >&2
                 fi
-                #if dhit_libkpathsea_configured && \
-                #    which fmtutil-sys >/dev/null; then
-                #    dhit_build_hyphen_format_if_format_exists \
-                #        latex $(kpsewhich language.dat)
-                #fi
             fi
         done
     ;;

Deleted: tex-common/branches/for-tl2008/scripts/postrm-texlsr
===================================================================
--- tex-common/branches/for-tl2008/scripts/postrm-texlsr	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/postrm-texlsr	2009-10-03 14:01:17 UTC (rev 4227)
@@ -1,81 +0,0 @@
-##
-## postrm-texlsr
-##
-## postrm snippets for calling mktexlsr and update-*
-##
-## Authors:
-##       Florent Rougon <f.rougon at free.fr>
-##       Norbert Preining <preining at logic.at>
-##
-# Please note that comments in this file are stripped before installation
-# by calling a grep -v '^[ \t]*# '
-# Thus, first lines containing ## are preserved!
-# So please be careful if you add stuff here!
-#
-
-
-# Tell if kpsewhich works. If this is the case:
-#
-#   1. kpsewhich is installed and;
-#
-#   2. libkpathsea is configured.
-dhit_libkpathsea_configured ()
-{
-    kpsewhich --version >/dev/null 2>&1
-}
-
-dhit_check_run_without_errors ()
-{
-    silent=0
-    if [ "$1" = "-silent" ] ; then
-        silent=1
-	shift
-    fi
-    if which "$1" >/dev/null; then
-        tempfile=$(mktemp -p /tmp checkrun.XXXXXXXX)
-        if [ $silent = 0 ] ; then
-	    printf "Running '$*'.\nThis may take some time..."
-	fi
-        set +e
-        if "$@" > $tempfile 2>&1 ; then
-            rm -f $tempfile
-            [ $silent = 0 ] && echo " done."
-        else
-            echo
-            echo "$* failed. Output has been stored in"
-            echo "$tempfile"
-            echo "This is probably not a bug. But if you encounter problems, report a bug" \
-            echo "and include this file in the bug report."
-            echo
-        fi
-        set -e
-    fi
-
-    return 0
-}
-
-case "$1" in
-    remove|disappear)
-        # It doesn't hurt to call all of them.
-        dhit_check_run_without_errors -silent update-updmap --quiet
-        dhit_check_run_without_errors -silent update-language
-        dhit_check_run_without_errors -silent update-fmtutil
-        # The mktexlsr call needs an installed and configured basic TeX
-        # system, so check this.
-        if dhit_libkpathsea_configured; then
-            dhit_check_run_without_errors \
-              mktexlsr #TEXMFTREES#
-        fi
-    ;;
-
-    purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument '$1'" >&2
-        exit 1
-    ;;
-esac
-
-# Let vim know that we don't want tabs
-# vim:set expandtab: #

Modified: tex-common/branches/for-tl2008/scripts/update-texmf-config
===================================================================
--- tex-common/branches/for-tl2008/scripts/update-texmf-config	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/update-texmf-config	2009-10-03 14:01:17 UTC (rev 4227)
@@ -21,17 +21,21 @@
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA  02110-1301 USA.
 
-DOLANGUAGE=off
+DOLSR=off
+DOHYPHEN=off
 DOUPDMAP=off
 
 while [ $# -ne 0 ]; do
   case $1 in
-    language)
-      DOLANGUAGE=on
+    hyphen)
+      DOHYPHEN=on
       shift;;
-    updmap)
+    map)
       DOUPDMAP=on
       shift;;
+    lsr)
+      DOLSR=on
+      shift;;
     *)
       echo "unknown option: $1"
       exit 1
@@ -39,16 +43,14 @@
   esac
 done
 
- 
-if [ $DOLANGUAGE = on ] ; then
-  # done in the trigger action of tex-common
-  # update-language
-  dpkg-trigger texmf-language
+if [ $DOLSR = on ] ; then
+  dpkg-trigger texmf-lsr
 fi
+if [ $DOHYPHEN = on ] ; then
+  dpkg-trigger texmf-hyphen
+fi
 if [ $DOUPDMAP = on ] ; then
-  # done in the trigger action of tex-common
-  # update-updmap
-  dpkg-trigger texmf-updmap
+  dpkg-trigger texmf-map
 fi
 
 # vim:set expandtab tabstop=2: #

Modified: tex-common/branches/for-tl2008/scripts/update-texmf-config.8
===================================================================
--- tex-common/branches/for-tl2008/scripts/update-texmf-config.8	2009-10-03 12:04:54 UTC (rev 4226)
+++ tex-common/branches/for-tl2008/scripts/update-texmf-config.8	2009-10-03 14:01:17 UTC (rev 4227)
@@ -16,19 +16,24 @@
 .PP
 .B update-texmf-config
 is a shell script that is called from maintainer scripts shipping new
-map files or hyphenation patterns for TeX, and dropping files into
-/etc/texmf/updmap.d and /etc/texmf/language.d, respectively.
+map files, hyphenation patterns, or any other TeX input
+file.
 .PP
-The script simply activates the respective trigger, namely texmf-updmap
-for font map files, and texmf-language for hyphenation patterns. All
+The script simply activates the respective trigger, namely texmf-map
+for font map files, texmf-hyphen for hyphenation patterns, and 
+texmf-lsr for updates to the lsr database. All
 the necessary action will then be carried out by the tex-common package.
 .SH OPTIONS
 .TP
-.B updmap
-Activate the texmf-updmap trigger.
+.B map
+Activate the texmf-map trigger.
 .TP
-.B language
-Activate the texmf-language trigger.
+.B hyphen
+Activate the texmf-hyphen trigger.
+.TP
+.B lsr
+Activate the texmf-lsr trigger.
+
 .SH SEE ALSO
 .PP
 Further information can be found in




More information about the Debian-tex-commits mailing list