[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

triggers support in tex-common



Hi guys,

I have started hacking a bit into tex-common for triggers. Since I want
to keep it separate, please check out
	tex-common/branches/triggers

The changes are:
- change update-texmf to do the stuff only when called with --real, 
  otherwise call dpkg-trigger /etc/texmf/texmf.d

- change update-fontlang to do the stuff only when called with --real,
  otherwise call dpkg-trigger /etc/texmf/XXXXX.d (fmt.d, ...)

- change postinst.in to echo a warning waht should be done (rest is
  missing) when called with "triggered"

- add interest on the four dirs /etc/texmf/{texmf.d,fmt.d, language.d,
  updmap.d}

If one of you has a bit more knowledge about all that please take a
look!!! I want to try the whole stuff with some local font package, but
first the tex-common.postinst stuff has to be fixed. I guess we have to
include the code from 
	scripts/postinst-tex and scripts/postinst-texlsr
which is normally added by dh_installtex to the postinst scripts of
other packages.

If there is anyone willing/able to work on that and help me a bit that
would be great!

For your convenience and review I attach the patch between the trunk and
trigger for now.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>        Vienna University of Technology
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
PABBY (n.,vb.)
(Fencing term.) The play, or manoeuvre, where one swordsman leaps on
to the table and pulls the battleaxe off the wall.
			--- Douglas Adams, The Meaning of Liff
Index: debian/triggers
===================================================================
--- debian/triggers	(revision 0)
+++ debian/triggers	(revision 0)
@@ -0,0 +1,4 @@
+interest /etc/texmf/fmt.d
+interest /etc/texmf/language.d
+interest /etc/texmf/texmf.d
+interest /etc/texmf/updmap.d
Index: debian/postinst.in
===================================================================
--- debian/postinst.in	(revision 3356)
+++ debian/postinst.in	(working copy)
@@ -36,6 +36,15 @@
 #################################################################
 
 case $action in
+  triggered)
+      # things to do:
+      # - go through all the triggers on the cmdline
+      # - call all the update-* scripts (it doesn't hurt)
+      # - go through all the triggers and call the respective fmtutil/updmap
+      #   calls.
+      echo "triggers not implemented by now: $*"
+      ;;
+      
   configure|reconfigure)
 
 # is there a file /etc/texmf/language.dat already? Move it out of the way
Index: scripts/update-fontlang
===================================================================
--- scripts/update-fontlang	(revision 3356)
+++ scripts/update-fontlang	(working copy)
@@ -4,7 +4,7 @@
 #                     from a set of files
 # Copyright (C) 2002 Atsuhito Kohda
 # Copyright (C) 2004, 2005, 2006, 2007 Florent Rougon
-# Copyright (C) 2005, 2006 Norbert Preining
+# Copyright (C) 2005, 2006, 2007, 2008 Norbert Preining
 # Copyright (C) 2007 Frank KÃŒster
 #
 # This program is free software; you can redistribute it and/or modify
@@ -88,7 +88,8 @@
       --quiet            don't write anything to the standard output during
                          normal operation
       --help             display this help message and exit
-      --version          output version information and exit"
+      --version          output version information and exit
+      --real             do actual processing, don't use triggers"
 
 
 DebPkgProvidedMaps_magic_comment="^[#%] -_- DebPkgProvidedMaps -_-"
@@ -466,7 +467,7 @@
 
 # -v (verbose) is here for backward compatibility only.
 TEMP=$(getopt -o +vc:o: --longoptions \
-    conf-dir:,output-file:,check,quiet,help,version \
+    conf-dir:,output-file:,check,quiet,help,version,real \
     -n "$progname" -- "$@")
 
 case $? in
@@ -492,6 +493,7 @@
 quiet=1
 dochecks=0
 output_file_specified=0
+real=0
 
 if [ $syswide_mode = 1 ]; then
     output_file="$SYSWIDE_DEFAULT_OUTPUTFILE"
@@ -541,6 +543,7 @@
             shift 2 ;;
         --quiet) quiet=1; shift ;;
         --check) dochecks=1; shift ;;
+        --real)  real=1; shift ;;
         -v) printf "\
 ${progname}'s -v option is deprecated. The default mode of operation will
 be verbose as soon as enough packages use the --quiet option. Please update
@@ -561,6 +564,8 @@
 
 # In user-specific mode, $conf_dir is required; let's check that.
 if [ $syswide_mode = 0 ]; then
+    # we set real mode to 1 if we are not running as root
+    real=1
     if [ -z "$conf_dir" ]; then
         printf "$progname: "
         cat >&2 <<EOF
@@ -576,6 +581,13 @@
     fi
 fi
 
+if [ $real = 0 ]; then
+    if type dpkg-trigger > /dev/null 2>&1 &&
+       dpkg-trigger $SYSWIDE_CONFDIR
+        exit 0
+    fi
+fi
+
 if [ -z "$output_file" ]; then
     printf "$progname: "
     cat >&2 <<EOF
Index: scripts/update-texmf
===================================================================
--- scripts/update-texmf	(revision 3356)
+++ scripts/update-texmf	(working copy)
@@ -14,6 +14,7 @@
 
 VERBOSE=false
 DEBUG=false
+REAL=false
 while [ $# -ne 0 ]; do
   case $1 in
     -v|--verbose)
@@ -23,6 +24,9 @@
       DEBUG=true
       VERBOSE=true
       shift;;
+    --read)
+      READ=true
+      shift;;
     *)
       echo "unknown option: $1"
       exit 1
@@ -30,6 +34,13 @@
   esac
 done
 
+if [ "${REAL}" = "false" ]; then
+  if type dpkg-trigger >/dev/null 2>&1 && 
+     dpkg-trigger /etc/texmf/texmf.d; then
+       exit 0
+  fi
+fi
+
 # test wether /etc isn't mounted read-only
 if touch /etc/texmf/is_rw 2>/dev/null; then
   rm -f /etc/texmf/is_rw

Reply to: