[subversion-commit] SVN tetex commit + diffs: r428 - in tex-common/trunk: debian scripts

Norbert Preining preining-guest at costa.debian.org
Thu Dec 22 15:40:08 UTC 2005


Author: preining-guest
Date: 2005-12-22 15:40:07 +0000 (Thu, 22 Dec 2005)
New Revision: 428

Modified:
   tex-common/trunk/debian/changelog
   tex-common/trunk/scripts/postinst-texfonts
   tex-common/trunk/scripts/postrm-texfonts
Log:
rework debhelper snippets


Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog	2005-12-22 14:51:35 UTC (rev 427)
+++ tex-common/trunk/debian/changelog	2005-12-22 15:40:07 UTC (rev 428)
@@ -4,8 +4,9 @@
   * Move debiandoc-sgml from Build-Dep to Build-Dep-Indep
   * Fix a couple of lintian errors and warnings
   * Fix dvips config syntax, thanks to Danai SAE-HAN [preining]
+  * Rework the debhelper snippets post(inst|rm)-texfonts [preining]
 
- -- Norbert Preining <preining at logic.at>  Thu, 22 Dec 2005 09:33:57 +0100
+ -- Norbert Preining <preining at logic.at>  Thu, 22 Dec 2005 16:38:54 +0100
 
 tex-common (0.13) unstable; urgency=low
 

Modified: tex-common/trunk/scripts/postinst-texfonts
===================================================================
--- tex-common/trunk/scripts/postinst-texfonts	2005-12-22 14:51:35 UTC (rev 427)
+++ tex-common/trunk/scripts/postinst-texfonts	2005-12-22 15:40:07 UTC (rev 428)
@@ -3,37 +3,57 @@
 #
 # postinst snippets for installing fonts for TeX
 #
-# Author: Florent Rougon <f.rougon at free.fr>
+# 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]*#'
 # So please be careful if you add stuff here!
 
-update_fontmaps()
+update_lsr_files ()
 {
-    update-updmap --quiet
-    # mktexlsr is recommended now because updmap-sys relies heavily on
-    # Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
-    # better not to specify a particular directory to refresh because
-    # updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
-    # $TEXMFMAIN.
-    # According to the Debian TeX policy, running mktexlsr and updmap-sys
-    # should work as long as tex-common is configured and these files are
-    # available (general Debian policy wouldn't assure that without this
-    # override from the Debian TeX policy).
-    if which mktexlsr >/dev/null; then mktexlsr; fi
-    if which updmap-sys >/dev/null; then
-        printf "Running updmap-sys... "
-        updmap-sys --quiet
-        echo "done."
+    tempfile=`mktemp -p /tmp mktexlsr.XXXXXXXX`
+    echo -n "Running mktexlsr. This may take some time. ..."
+    if mktexlsr > $tempfile 2>&1 ; then
+        rm -f $tempfile
+	echo " done."
+    else
+    	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
+}
 
-    return 0
+create_fontmaps ()
+{
+    tempfile=`mktemp -p /tmp updmap.XXXXXXXX`
+    echo -n "Running updmap-sys. This may take some time. ..."
+    if updmap-sys > $tempfile 2>&1 ; then
+    	rm -f $tempfile
+	echo " done."
+    else
+    	echo
+	echo "updmap 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)
-        update_fontmaps
+        update-updmap
+	if which mktexlsr >/dev/null; then 
+	    update_lsr_files
+	fi
+	if which updmap-sys >/dev/null; then
+	    create_fontmaps
+	fi
     ;;
 
     *)

Modified: tex-common/trunk/scripts/postrm-texfonts
===================================================================
--- tex-common/trunk/scripts/postrm-texfonts	2005-12-22 14:51:35 UTC (rev 427)
+++ tex-common/trunk/scripts/postrm-texfonts	2005-12-22 15:40:07 UTC (rev 428)
@@ -3,35 +3,15 @@
 #
 # postrm snippets for installing fonts for TeX
 #
-# Author: Florent Rougon <f.rougon at free.fr>
+# 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]*#'
 # So please be careful if you add stuff here!
 
-tell_that_errors_are_ok()
-{
-    # Cheap option handling...
-    if [ "$1" = -n ]; then
-        prog="$2"
-        endwith=' '
-    else
-        prog="$1"
-        endwith='\n'
-    fi
-
-    # According to the Debian TeX policy, running mktexlsr and updmap-sys
-    # should work as long as tex-common is configured and these files are
-    # available (general Debian policy wouldn't assure that without this
-    # override from the Debian TeX policy).
-    printf "\
-Trying to run '$prog' (error messages can be ignored if tex-common
-is not configured)...$endwith"
-
-    return 0
-}
-
-# The function name is *try_to*_update_fontmaps because the following
+# The function name is check_run_without_erros because the following
 # scenario might happen:
 #    1. this package is deconfigured
 #    2. tex-common and tetex-bin are removed
@@ -40,54 +20,41 @@
 # (cf. Policy § 6.5, step 2, about a conflicting package being removed due
 # to the installation of the package being discussed).
 #
-# In this case, update-updmap, mktexlsr and updmap-sys would all be gone once
-# tex-common and tetex-bin are removed, so we must append "|| true" to their
-# calls.
-try_to_update_fontmaps()
+check_run_without_errors ()
 {
-    # Don't print alarming error messages if the programs aren't even
-    # available.
-    if which update-updmap >/dev/null; then
-        tell_that_errors_are_ok -n update-updmap
-        update-updmap --quiet || true
-        echo "done."
+    tempfile=`mktemp -p /tmp checkrun.XXXXXXXX`
+    if which $1  >/dev/null; then
+        echo -n "Running $*. This may take some time. ..."
+	set +e
+	if $* > $tempfile 2>&1 ; then
+	    rm -f $tempfile
+	    echo " done."
+	else
+	    echo
+	    echo "$* failed. Output has been stored in"
+	    echo "$tempfile"
+	    echo "If tex-common is not configured you can ignore this error message!"
+	    echo "Otherwise please include this file if you report a bug."
+	    echo
+	fi
+	set -e
+    else
+        rm -f $tempfile
     fi
-    # mktexlsr is recommended now because updmap-sys relies heavily on
-    # Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
-    # better not to specify a particular directory to refresh because
-    # updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
-    # $TEXMFMAIN.
-    if which mktexlsr >/dev/null; then
-        tell_that_errors_are_ok mktexlsr
-        mktexlsr || true
-        echo "done."
-    fi
-
-    if which updmap-sys >/dev/null; then
-        tell_that_errors_are_ok -n updmap-sys
-        updmap-sys --quiet || true
-        echo "done."
-    fi
-
     return 0
 }
 
+
 case "$1" in
     remove|disappear)
-        try_to_update_fontmaps
+        check_run_without_errors update-updmap
+	check_run_without_errors mktexlsr
+	check_run_without_errors updmap-sys
     ;;
 
-    purge)
-        # Supposing updmap.cfg & Co are clean (which I think is a reasonable
-        # assumption), we don't need to call try_to_update_fontmaps().
-        # Calling it on remove _and_ on purge just for hypothetical users
-        # who would break their config before purging this package seems to
-        # be more annoying than useful (it takes a lot of time).
+    purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
     ;;
 
-    upgrade|failed-upgrade|abort-upgrade|abort-install)
-    ;;
-
     *)
         echo "postrm called with unknown argument \`$1'" >&2
         exit 1




More information about the Pkg-tetex-commits mailing list