[Debian-tex-commits] SVN tex-common commit + diffs: r3373 - in tex-common/branches/triggers: debian scripts

Norbert Preining preining at alioth.debian.org
Wed May 14 16:22:16 UTC 2008


Author: preining
Date: 2008-05-14 16:22:16 +0000 (Wed, 14 May 2008)
New Revision: 3373

Modified:
   tex-common/branches/triggers/debian/control
   tex-common/branches/triggers/debian/postinst.in
   tex-common/branches/triggers/debian/triggers
   tex-common/branches/triggers/scripts/dh_installtex
   tex-common/branches/triggers/scripts/postinst-texlsr
   tex-common/branches/triggers/scripts/update-fontlang
Log:
fmtutil triggers


Modified: tex-common/branches/triggers/debian/control
===================================================================
--- tex-common/branches/triggers/debian/control	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/debian/control	2008-05-14 16:22:16 UTC (rev 3373)
@@ -11,7 +11,7 @@
 
 Package: tex-common
 Architecture: all
-Depends: ucf, debconf (>= 1.4.69) | cdebconf (>= 0.39)
+Depends: ucf, debconf (>= 1.4.69) | cdebconf (>= 0.39), dpkg (>= 1.14.18)
 Suggests: debhelper (>= 4.0)
 Replaces: tetex-base (<= 3.0-10)
 Conflicts: tetex-base (<< 2007)

Modified: tex-common/branches/triggers/debian/postinst.in
===================================================================
--- tex-common/branches/triggers/debian/postinst.in	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/debian/postinst.in	2008-05-14 16:22:16 UTC (rev 3373)
@@ -37,45 +37,80 @@
 #################################################################
 
 case $action in
-  triggered)
-      # currently we only support only one trigger for updmap.d changes
-      # because all the other calls are quite fast 
-      # - call all the update-* scripts (it doesn't hurt)
-      # - go through all the triggers and call the respective fmtutil/updmap
-      #   calls.
-      # we currently do ONLY the trigger for the updmap.d
-      case " $trigger " in
-      *" /etc/texmf/updmap.d "*) 
-        # do the processing
-	    # code from postinst.tex
-	    if dhit_libkpathsea_configured; then
-	        if which updmap-sys >/dev/null; then
-                tempfile=$(mktemp -p /tmp updmap.XXXXXXXX)
-                update-updmap --quiet --real
-                printf "Running updmap-sys. This may take some time... "
-                if updmap-sys > $tempfile 2>&1 ; then
-                    rm -f $tempfile
-                    echo "done."
-                else
-                    exec >&2
-                    echo
-                    echo "updmap-sys 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
-            fi
-        fi
-	 ;;
-      esac
-      ;;
+    triggered)
+        # currently we only support only triggers for updmap.d and
+        # language.d changes
+        # because all the other calls are quite fast 
+        # - call all the update-* scripts (it doesn't hurt)
+        # - go through all the triggers and call the respective fmtutil/updmap
+        #   calls.
+
+        # in any case call the update-updmap --real ...
+        update-updmap --real --quiet
+        update-language --real
+        update-fmtutil --real
+        case " $trigger " in
+            *" /etc/texmf/updmap.d "*) 
+                # do the processing
+	            # code from postinst.tex
+	            if dhit_libkpathsea_configured; then
+	                if which updmap-sys >/dev/null; then
+                        tempfile=$(mktemp -p /tmp updmap.XXXXXXXX)
+                        printf "Running updmap-sys. This may take some time... "
+                        if updmap-sys > $tempfile 2>&1 ; then
+                            rm -f $tempfile
+                            echo "done."
+                        else
+                            exec >&2
+                            echo
+                            echo "updmap-sys 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
+                    fi
+                fi
+            ;;
+        esac
+        case " $trigger " in
+            *" /etc/texmf/language.d "*) 
+                # do the processing
+	            # 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
+                        exec >&2
+                        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
+                fi
+            ;;
+        esac
+    ;;
       
-  configure|reconfigure)
+    configure|reconfigure)
 
 # is there a file /etc/texmf/language.dat already? Move it out of the way
     if [ -f $OLD_LDAT ]; then

Modified: tex-common/branches/triggers/debian/triggers
===================================================================
--- tex-common/branches/triggers/debian/triggers	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/debian/triggers	2008-05-14 16:22:16 UTC (rev 3373)
@@ -1 +1,2 @@
 interest /etc/texmf/updmap.d
+interest /etc/texmf/language.d

Modified: tex-common/branches/triggers/scripts/dh_installtex
===================================================================
--- tex-common/branches/triggers/scripts/dh_installtex	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/scripts/dh_installtex	2008-05-14 16:22:16 UTC (rev 3373)
@@ -215,6 +215,10 @@
 exists, dh_installtex will skip this format with an informational
 message, even if this option is not given.
 
+<language:notriggers> allows to circumvent the delayed calls to fmtutil-sys
+using triggers. Use this only if other postinst code requires that the
+hyphenation patterns are properly installed.
+
 =head1 NOTES
 
 Note that this command is not idempotent. "dh_clean -k" should be called
@@ -241,7 +245,8 @@
 my @addbuildformats = (); # additional formats to be build
 my $priority=20;	# priority with which files are installed
 my $doformatlinks = 1;
-my $donotriggers = 0;
+my $no_updmap_triggers = 0;
+my $no_language_triggers = 0;
 my %cmdlineargs;
 my %cmdlinefiles;
 my %cmdlinefilespriority;
@@ -416,7 +421,9 @@
 		} elsif ($fl eq "format:no_links") {
 			$doformatlinks = 0;
 		} elsif ($fl eq "map:notriggers") {
-			$donotriggers = 1;
+			$no_updmap_triggers = 1;
+		} elsif ($fl eq "language:notriggers") {
+			$no_language_triggers = 1;
 		} else {
 			error("Specified flavor $fl not supported.\nPlease see man page for supported flavors!\n");
 		}
@@ -647,15 +654,17 @@
 			# updmap-sys is now done with triggers, so we should 
 			# filter out the "map" from the @whattodo list
 			# but only if we are not running with flavor notriggers
-			if (!$donotriggers) {
-				my @newwhat = ();
-				foreach my $t (@whattodo) {
-					if ($t ne "map") {
-						push @newwhat, $t;
-					}
+			my @newwhat = ();
+			foreach my $t (@whattodo) {
+				if ($t eq "map") {
+					push @newwhat, $t unless $no_updmap_triggers;
+				} elsif ($t eq "language") {
+					push @newwhat, $t unless $no_language_triggers;
+				} else {
+					push @newwhat, $t;
 				}
-				@whattodo = @newwhat;
 			}
+			@whattodo = @newwhat;
 			autoscript($package, "postinst", "postinst-tex", "s|#FORMATSFILES#|@fmtconffiles|; s|#WHATTODO#|@whattodo|");
 			autoscript($package, "postrm",   "postrm-tex", "s|#FORMATS#|@postrmfmtdata|; s|#WHATTODO#|@whattodo|");
 		}

Modified: tex-common/branches/triggers/scripts/postinst-texlsr
===================================================================
--- tex-common/branches/triggers/scripts/postinst-texlsr	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/scripts/postinst-texlsr	2008-05-14 16:22:16 UTC (rev 3373)
@@ -46,11 +46,6 @@
 
 case "$1" in
     configure|abort-upgrade|abort-remove|abort-deconfigure)
-        # It doesn't hurt to call all of them.
-        # These programs are all in tex-common and can be run immediately.
-        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

Modified: tex-common/branches/triggers/scripts/update-fontlang
===================================================================
--- tex-common/branches/triggers/scripts/update-fontlang	2008-05-13 12:34:16 UTC (rev 3372)
+++ tex-common/branches/triggers/scripts/update-fontlang	2008-05-14 16:22:16 UTC (rev 3373)
@@ -28,7 +28,7 @@
 
 if [ "$progname" = "update-language" ] ; then
     CNFDIR=language.d
-    USE_TRIGGER=0
+    USE_TRIGGER=1
     # System-wide configuration directory
     SYSWIDE_CONFDIR=/etc/texmf/$CNFDIR
     CHECKFILE="$SYSWIDE_CONFDIR/00tex.cnf"




More information about the Debian-tex-commits mailing list