Bug#64914: none
In order to disable that file on removal and keep policy compliant,
the fmt.d snippet needs to be a configuration file but not a conffile.
The included is a diff for my maintainer scripts which implements the
handling for the fmt.d snippet. I'm sending this to you all for
comment, since you seemed interested.
It's untested, but I'm about to test it and play around with it,
should be uploaded shortly.
--
...Adam Di Carlo..<adam@onshore-devel.com>...<URL:http://www.onshored.com/>
=== cd /home/adam/debian/jadetex/jadetex/debian/
=== /usr/bin/cvs diff -u changelog postinst postrm prerm rules
Index: changelog
===================================================================
RCS file: /usr/local/cvs/debian/jadetex/debian/changelog,v
retrieving revision 1.57
diff -u -u -r1.57 changelog
--- changelog 10 Mar 2002 20:42:02 -0000 1.57
+++ changelog 30 Mar 2002 21:14:21 -0000
@@ -1,3 +1,15 @@
+jadetex (3.12-2) unstable; urgency=low
+
+ * control: require tetex-bin >= 1.0.7+20011202-5.1 for new machinery to
+ let our memory dumps stay up-to-date
+ * use new update-fmtutil system: we install fmtutil.cnf to
+ /etc/texmf/fmt.d/40jadetex.cnf during installation (it's a
+ configuration file, not a conffile), disable that on package removal,
+ re-enable on install if possible preserving user configuration, purge
+ on purge
+
+ -- Adam Di Carlo <aph@debian.org> Sat, 30 Mar 2002 16:14:21 -0500
+
jadetex (3.12-1) unstable; urgency=low
* new upstream version
Index: postinst
===================================================================
RCS file: /usr/local/cvs/debian/jadetex/debian/postinst,v
retrieving revision 1.16
diff -u -u -r1.16 postinst
--- postinst 6 Mar 2002 22:36:16 -0000 1.16
+++ postinst 30 Mar 2002 21:08:26 -0000
@@ -9,7 +9,9 @@
TEXMF=
TEXINPUTS=
-ETC_CONFIG=/etc/texmf/jadetex
+FMTDIR=/etc/texmf/fmt.d
+TEMPLDIR=/usr/share/texmf/tex/jadetex/config-templates
+
umask 022
# emit a warning, generic routine
@@ -84,12 +97,30 @@
texhash
- if [ ! -f "$ETC_CONFIG/fmtutil.cnf" ]; then
- echo "no file $ETC_CONFIG/fmtutil.cnf, cannot create JadeTeX memory dumps"
- echo " fatal error"
- exit 1
+ # new fmt.d handling; we have to handle this in postinst rather
+ # than conffiles so that we can disable it when pkg is removed
+ #
+ # first we check if the file or any jadetex.cnf file is already there,
+ # if not, is there is a disabled version of the script available?
+ # if not, is there a globbed version of the disabled file available?
+ # if not, copy in the file from the template area
+ if [ -f ${FMTDIR}/40jadetex.cnf ] ||
+ ls ${FMTDIR}/*jadetex.cnf 2>/dev/null; then
+ :
+ elif [ -f ${FMTDIR}/40jadetex.cnf.disable ]; then
+ mv ${FMTDIR}/40jadetex.cnf.disable ${FMTDIR}/40jadetex.cnf
+ else
+ OLD=`ls -1 ${FMTDIR}/*jadetex.cnf* | tail -1`
+ if [ -f ${OLD} ]; then
+ NEW=`echo $OLD | sed -e 's/.cnf.*/.cnf/'`
+ mv ${OLD} ${NEW}
+ else
+ cp ${TEMPLDIR}/fmtutil.cnf ${FMTDIR}/40jadetex.cnf
+ fi
fi
+ update-fmtutil
+
MYTMPFILE=`mktemp /tmp/jadetex-postinst.XXXXXX`
: > $MYTMPFILE
@@ -109,8 +140,7 @@
echo " memory dumps ..."
fmtutil --all >> $MYTMPFILE
echo " done."
- echo "Retrying to create JadeTeX memory dumps ..."
- makejadetexfmt
+ echo "Re-checking for JadeTeX memory dumps ..."
if jadetexfmtcheck; then
echo " done."
else
Index: postrm
===================================================================
RCS file: /usr/local/cvs/debian/jadetex/debian/postrm,v
retrieving revision 1.8
diff -u -u -r1.8 postrm
--- postrm 11 Jul 2001 00:41:24 -0000 1.8
+++ postrm 30 Mar 2002 21:13:00 -0000
@@ -4,10 +4,11 @@
set -e
ETC_CONFIG=/etc/texmf/jadetex
-
+FMTDIR=/etc/texmf/fmt.d
if [ "$1" = "purge" ]; then
rm -rf $ETC_CONFIG || true
+ rm -f ${FMTDIR}/*jadetex.cnf*
fi
#DEBHELPER#
Index: prerm
===================================================================
RCS file: /usr/local/cvs/debian/jadetex/debian/prerm,v
retrieving revision 1.2
diff -u -u -r1.2 prerm
--- prerm 2 Nov 2001 22:46:09 -0000 1.2
+++ prerm 30 Mar 2002 21:11:27 -0000
@@ -9,10 +9,9 @@
TEXINPUTS=
ETC_CONFIG=/etc/texmf/jadetex
-
+FMTDIR=/etc/texmf/fmt.d
if [ "$1" = "remove" ]; then
-
# remove the fmt files created at postinst
JADETEXFMT=$(kpsewhich jadetex.fmt) || true
PDFJADETEXFMT=$(kpsewhich pdfjadetex.fmt) || true
@@ -21,6 +20,12 @@
# remove the logs created as a sideeffect
WEB2CDIR=$(dirname $JADETEXFMT) || true
rm -f $WEB2CDIR/jadetex.log $WEB2CDIR/pdfjadetex.log
+
+ # disable the fmt.d bit and recreate fmtutil.cnf
+ if [ -f ${FMTDIR}/40jadetex.cnf ]; then
+ mv ${FMTDIR}/40jadetex.cnf ${FMTDIR}/40jadetex.cnf.disable
+ fi
+ update-fmtutil
fi
# the upgrade case will be handled in postinst; no need to run it twice
--
To UNSUBSCRIBE, email to debian-tetex-maint-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: