[Debian-tex-commits] SVN tex-common commit + diffs: r3403 - in tex-common/trunk: debian scripts

Norbert Preining preining at alioth.debian.org
Mon Jun 2 14:40:45 UTC 2008


Author: preining
Date: 2008-06-02 14:40:45 +0000 (Mon, 02 Jun 2008)
New Revision: 3403

Modified:
   tex-common/trunk/debian/changelog
   tex-common/trunk/debian/control
   tex-common/trunk/debian/postinst.in
   tex-common/trunk/scripts/dh_installtex
   tex-common/trunk/scripts/postinst-texlsr
Log:
add trigger support, bump version to 1.12~1


Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog	2008-06-02 14:39:02 UTC (rev 3402)
+++ tex-common/trunk/debian/changelog	2008-06-02 14:40:45 UTC (rev 3403)
@@ -1,4 +1,4 @@
-tex-common (1.11.1~1) unstable; urgency=normal
+tex-common (1.12~1) experimental; urgency=normal
 
   * bump version of tex-common packages built with dh_installtex to 1.11
     otherwise the conflict with tetex-base is not included properly. This really
@@ -16,8 +16,10 @@
   * fix wrong file link in Debian-TeX-Policy.sgml (Closes: #481038) 
   * Again install the README file for tpm2licenses in
     /usr/share/tex-common/ [fk]
+  * implement support for triggers for /etc/texmf/updmap.d and
+    /etc/texmf/language.d [np]
 
- -- Norbert Preining <preining at debian.org>  Mon, 02 Jun 2008 16:36:59 +0200
+ -- Norbert Preining <preining at debian.org>  Mon, 02 Jun 2008 16:40:03 +0200
 
 tex-common (1.11) unstable; urgency=medium
 

Modified: tex-common/trunk/debian/control
===================================================================
--- tex-common/trunk/debian/control	2008-06-02 14:39:02 UTC (rev 3402)
+++ tex-common/trunk/debian/control	2008-06-02 14:40:45 UTC (rev 3403)
@@ -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/trunk/debian/postinst.in
===================================================================
--- tex-common/trunk/debian/postinst.in	2008-06-02 14:39:02 UTC (rev 3402)
+++ tex-common/trunk/debian/postinst.in	2008-06-02 14:40:45 UTC (rev 3403)
@@ -21,6 +21,7 @@
 
 # Give a name to the first commandline argument
 action=$1
+trigger=$2
 
 . <:=${CONFMODULE}:>
 db_version 2.0
@@ -36,8 +37,81 @@
 #################################################################
 
 case $action in
-  configure|reconfigure)
+    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-* calls
+        update-updmap --quiet
+        update-language
+        update-fmtutil
+        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)
+
 # is there a file /etc/texmf/language.dat already? Move it out of the way
     if [ -f $OLD_LDAT ]; then
       old_ldat_md5sum=`md5sum $OLD_LDAT`
@@ -220,6 +294,9 @@
 
 #DEBHELPER#
 
-# Local Variables:
-# mode: shell-script
-# End:
+### Local Variables:
+### perl-indent-level: 4
+### tab-width: 4
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=4 expandtab: #

Modified: tex-common/trunk/scripts/dh_installtex
===================================================================
--- tex-common/trunk/scripts/dh_installtex	2008-06-02 14:39:02 UTC (rev 3402)
+++ tex-common/trunk/scripts/dh_installtex	2008-06-02 14:40:45 UTC (rev 3403)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 # dh_installtex --- register Type 1 fonts, languages, or formats with TeX
 # Copyright (C) 2006, 2007 Florent Rougon
-# Copyright (C) 2006, 2007 Norbert Preining
+# Copyright (C) 2006, 2007, 2008 Norbert Preining
 # Copyright (C) 2006, 2007 Frank Küster
 #
 # This program is free software; you can redistribute it and/or modify
@@ -176,8 +176,9 @@
 This option will be used to switch additional options on. The argument
 specify a list from flavors to be selected.
 At the moment you can select from the following list of flavors:
-B<map:config_for_active_maps>, B<map:config_for_all_maps>,
-B<format:build_all>, and B<format:add_one:I<formatname>>.
+B<map:config_for_active_maps>, B<map:config_for_all_maps>, B<map:notriggers>,
+B<format:build_all>, B<format:add_one:I<formatname>>, and 
+B<language:notriggers>.
 
 B<map:config_for_active_maps> will create a file I<config.bar> for each active
 (i.e. uncommented) map in each of the cfg file generated by one of the
@@ -193,6 +194,10 @@
 
 Default is I<not> to generate any config files.
 
+B<map:notriggers> allows to circumvent the delayed calls to updmap-sys
+using triggers. Use this only if other postinst code requires that the
+fonts are properly installed.
+
 B<format:build_all> will add code to the postinst script to create all
 defined formats, and to the postrm script to clean and recreate? FIXME?
 the generated formats.
@@ -211,6 +216,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
@@ -237,6 +246,8 @@
 my @addbuildformats = (); # additional formats to be build
 my $priority=20;	# priority with which files are installed
 my $doformatlinks = 1;
+my $no_updmap_triggers = 0;
+my $no_language_triggers = 0;
 my %cmdlineargs;
 my %cmdlinefiles;
 my %cmdlinefilespriority;
@@ -410,6 +421,10 @@
 			push @addbuildformats , $1;
 		} elsif ($fl eq "format:no_links") {
 			$doformatlinks = 0;
+		} elsif ($fl eq "map:notriggers") {
+			$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");
 		}
@@ -637,12 +652,28 @@
 		autoscript($package, "postinst", "postinst-texlsr", "s|#TEXMFTREES#|@foo|");
 		autoscript($package, "postrm",   "postrm-texlsr", "s|#TEXMFTREES#|@foo|");
 		if ($dothefullstuff) {
+			# 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
+			my @newwhat = ();
+			foreach my $t (@whattodo) {
+				if ($t eq "map") {
+					push @newwhat, $t if $no_updmap_triggers;
+				} elsif ($t eq "language") {
+					push @newwhat, $t if $no_language_triggers;
+				} else {
+					push @newwhat, $t;
+				}
+			}
+			@whattodo = @newwhat;
 			autoscript($package, "postinst", "postinst-tex", "s|#FORMATSFILES#|@fmtconffiles|; s|#WHATTODO#|@whattodo|");
 			autoscript($package, "postrm",   "postrm-tex", "s|#FORMATS#|@postrmfmtdata|; s|#WHATTODO#|@whattodo|");
 		}
 	}
 
-	addsubstvar($package, "misc:Depends", "tex-common", ">= 1.11");
+	# for trigger support
+	addsubstvar($package, "misc:Depends", "dpkg", ">= 1.14.18");
+	addsubstvar($package, "misc:Depends", "tex-common", ">= 1.12");
 }
 
 =head1 SEE ALSO

Modified: tex-common/trunk/scripts/postinst-texlsr
===================================================================
--- tex-common/trunk/scripts/postinst-texlsr	2008-06-02 14:39:02 UTC (rev 3402)
+++ tex-common/trunk/scripts/postinst-texlsr	2008-06-02 14:40:45 UTC (rev 3403)
@@ -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




More information about the Debian-tex-commits mailing list