Hi,

here's a patch that would mostly fix all three RC bugs of xmltex.  What
I didn't notice when I reported #345223 is that the missing proper
conffile handling caused 340076: although there is a new working
configuration file in the package, it was not updated.

One thing is missing in the patch, and that is to remove the files from
/etc/texmf that are now in /usr/share/texmf;  this must either be done
unconditionally (in this case don't remove them, but move them to
/etc/texmf/oldstuff_unused (creating it if it doesn't exist)), or by
checking with known md5sums whether they have changed.  Note that the
ini files won't be found at their old places in /etc/texmf/xmltex.

I haven't tested the patch, but since I'm leaving for vacation tomorrow,
I decided to post it nevertheless.

Regards, Frank

diff -Nur xmltex-1.9/debian/changelog xmltex-1.9.new/debian/changelog
--- xmltex-1.9/debian/changelog 2005-12-30 10:52:23.874581088 +0100
+++ xmltex-1.9.new/debian/changelog     2005-12-30 10:59:40.466209072 +0100
@@ -1,3 +1,17 @@
+xmltex (1.9-11.1) unstable; urgency=low
+
+  * NMU version number to test patch
+  * Drop special handling of the configuration files in texmf.d and
+    fmt.d, and make them conffiles (since they don't seem to have changed
+    for long, this should be safe) (closes: #340076)
+  * Move ini files to /usr/share/texmf/tex/xmltex/config, in accordance
+    with TeX Policy on configuration files, and to allow the fmtutil
+    configuration snippet to be treated as a conffile; drop dh_link
+    (closes: #345223)
+  * Call fmtutil-sys if it is available (closes: #338327)
+
+ -- Frank Küster <[EMAIL PROTECTED]>  Thu, 29 Dec 2005 20:16:32 +0100
+
 xmltex (1.9-11) unstable; urgency=low
 
   * debian/postinst: Do not check for the created format files, because
diff -Nur xmltex-1.9/debian/rules xmltex-1.9.new/debian/rules
--- xmltex-1.9/debian/rules     2005-12-30 10:52:23.875580936 +0100
+++ xmltex-1.9.new/debian/rules 2005-12-29 20:18:30.000000000 +0100
@@ -45,7 +45,7 @@
                dh_installchangelogs
                dh_installexamples
                dh_installman
-               dh_link
+#              dh_link
                dh_compress
                dh_fixperms
                dh_installdeb
diff -Nur xmltex-1.9/debian/xmltex.links xmltex-1.9.new/debian/xmltex.links
--- xmltex-1.9/debian/xmltex.links      2005-12-30 10:52:23.875580936 +0100
+++ xmltex-1.9.new/debian/xmltex.links  1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-/etc/texmf/xmltex usr/share/texmf/tex/xmltex/config
diff -Nur xmltex-1.9/debian/xmltex.postinst 
xmltex-1.9.new/debian/xmltex.postinst
--- xmltex-1.9/debian/xmltex.postinst   2005-12-30 10:52:23.876580784 +0100
+++ xmltex-1.9.new/debian/xmltex.postinst       2005-12-29 19:59:44.000000000 
+0100
@@ -7,6 +7,9 @@
 
 set -e
 
+fmtutil=fmtutil
+if [ -x /usr/bin/fmtutil-sys ]; then fmtutil=fmtutil-sys; fi
+
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
 #        * <old-postinst> `abort-upgrade' <new version>
@@ -33,43 +36,43 @@
    echo $* 1>&2
 }
 
-installconf () {
-    # mv on disable file or copy template
-    while [ $# -gt 0 ]; do
-        conffile=$1
-        shift
-        if [ -f $conffile ] ; then
-           :
-        elif [ -f $conffile.disable ]; then
-            mv $conffile.disable $conffile
-        else
-            cp $TMPLDIR/`basename $conffile` $conffile
-        fi
-    done
-}
-
-checkconf ( ) {
-    # Treat old conffiles
-    if [ -f $TEXMFDIR/20xmltex ] ; then
-        mv $TEXMFDIR/20xmltex $TEXMFDIR/20xmltex.cnf
-    fi
-
-    if [ -f /etc/texmf/xmltex.cfg ] ; then
-        mv -f /etc/texmf/xmltex.cfg /etc/texmf/xmltex/xmltex.cfg
-    fi
+# installconf () {
+#     # mv on disable file or copy template
+#     while [ $# -gt 0 ]; do
+#         conffile=$1
+#         shift
+#         if [ -f $conffile ] ; then
+#            :
+#         elif [ -f $conffile.disable ]; then
+#             mv $conffile.disable $conffile
+#         else
+#             cp $TMPLDIR/`basename $conffile` $conffile
+#         fi
+#     done
+# }
+
+# checkconf ( ) {
+#     # Treat old conffiles
+#     if [ -f $TEXMFDIR/20xmltex ] ; then
+#         mv $TEXMFDIR/20xmltex $TEXMFDIR/20xmltex.cnf
+#     fi
+
+#     if [ -f /etc/texmf/xmltex.cfg ] ; then
+#         mv -f /etc/texmf/xmltex.cfg /etc/texmf/xmltex/xmltex.cfg
+#     fi
 
-    # copy template files
-    installconf $TEXMFDIR/20xmltex.cnf $FMTDIR/40xmltex.cnf
+#     # copy template files
+#     installconf $TEXMFDIR/20xmltex.cnf $FMTDIR/40xmltex.cnf
     
-}
+# }
 
 checkfmt ( ) {
     format=$1
     baseformat=$(basename $1 .efmt)
     if ! kpsewhich $format > /dev/null ; then
         warn "WARNING: $format not found, attempting to reconstruct ..."
-        echo "running 'fmtutil --byfmt $baseformat'" >> $MYTMP
-        fmtutil --byfmt $baseformat >> $MYTMP
+        echo "running '$fmtutil --byfmt $baseformat'" >> $MYTMP
+        $fmtutil --byfmt $baseformat >> $MYTMP
         if kpsewhich $format > /dev/null ; then
             warn "Success"
         else
@@ -84,14 +87,14 @@
     local goterror
     goterror=false
 
-    if ! fmtutil --byfmt xmltex >> $MYTMP
+    if ! $fmtutil --byfmt xmltex >> $MYTMP
     then
-        warn "ERROR: xmltex fmtutil failed" 1>&2
+        warn "ERROR: xmltex $fmtutil failed" 1>&2
         goterror=true
     fi
-    if ! fmtutil --byfmt pdfxmltex >> $MYTMP
+    if ! $fmtutil --byfmt pdfxmltex >> $MYTMP
     then
-        warn "ERROR: pdfxmltex fmtutil failed" 1>&2
+        warn "ERROR: pdfxmltex $fmtutil failed" 1>&2
         goterror=true
     fi
     if $goterror; then
@@ -101,47 +104,48 @@
     fi
 }
 
-xmltexfmtcheck ( ) {
-    # check whether it actually worked, since the texconfig program
-    # doesn't exit non-zero
-
-    if grep -q '^xmltex[[:space:]]*tex' $FMTDIR/40xmltex.cnf; then
-       xml_fmt="xmltex.fmt";
-    else
-       xml_fmt="xmltex.efmt";
-    fi;
-
-    if grep -q '^pdfxmltex[[:space:]]*pdftex' $FMTDIR/40xmltex.cnf; then
-       pdf_fmt="pdfxmltex.fmt";
-    else
-       pdf_fmt="pdfxmltex.efmt";
-    fi;
-
-
-    # file exists test
-    local goterror
-    goterror=false
-    if ! kpsewhich $xml_fmt > /dev/null ; then
-        warn "ERROR: XMLTeX memory dump ($xml_fmt) cannot be found"
-        goterror=true
-    fi
-    if ! kpsewhich $pdf_fmt > /dev/null ; then
-        warn "ERROR: PDFXMLTeX memory dump ($pdf_fmt) cannot be found"
-        goterror=true
-    fi
-
-    if $goterror; then
-        return -1
-    else
-        return 0
-    fi
-}
+# bad and previously unused 
+# xmltexfmtcheck ( ) {
+#     # check whether it actually worked, since the texconfig program
+#     # doesn't exit non-zero
+
+#     if grep -q '^xmltex[[:space:]]*tex' $FMTDIR/40xmltex.cnf; then
+#      xml_fmt="xmltex.fmt";
+#     else
+#      xml_fmt="xmltex.efmt";
+#     fi;
+
+#     if grep -q '^pdfxmltex[[:space:]]*pdftex' $FMTDIR/40xmltex.cnf; then
+#      pdf_fmt="pdfxmltex.fmt";
+#     else
+#      pdf_fmt="pdfxmltex.efmt";
+#     fi;
+
+
+#     # file exists test
+#     local goterror
+#     goterror=false
+#     if ! kpsewhich $xml_fmt > /dev/null ; then
+#         warn "ERROR: XMLTeX memory dump ($xml_fmt) cannot be found"
+#         goterror=true
+#     fi
+#     if ! kpsewhich $pdf_fmt > /dev/null ; then
+#         warn "ERROR: PDFXMLTeX memory dump ($pdf_fmt) cannot be found"
+#         goterror=true
+#     fi
+
+#     if $goterror; then
+#         return -1
+#     else
+#         return 0
+#     fi
+# }
 
 
 
 case "$1" in
     configure)
-        checkconf
+#         checkconf
 
         update-fmtutil
 
@@ -157,8 +161,8 @@
            rm $MYTMP
             echo "Done."
         else
-           echo "Trying fmtutil --all"
-           if fmtutil --all >>$MYTMP; then
+           echo "Trying $fmtutil --all"
+           if $fmtutil --all >>$MYTMP; then
                rm $MYTMP
                echo "   done."
             else
diff -Nur xmltex-1.9/Makefile xmltex-1.9.new/Makefile
--- xmltex-1.9/Makefile 2005-12-30 10:52:23.876580784 +0100
+++ xmltex-1.9.new/Makefile     2005-12-29 20:21:11.000000000 +0100
@@ -7,7 +7,8 @@
 
 ## ----------------------------------------------------------------------
 prefix         = 
-confdir                = $(prefix)/etc/texmf/$(package)
+etctexmf       = $(prefix)/etc/texmf
+confdir                = $(etctexmf)/$(package)
 sharedir       = $(prefix)/usr/share/texmf/tex/$(package)
 
 ## ----------------------------------------------------------------------
@@ -16,12 +17,15 @@
                dvips -o manual.ps manual
 
 install:
-               install -m 0755 -d $(confdir)
-               install -m 0644 *.ini xmltex.cfg $(confdir)
+               install -m 0755 -d $(etctexmf)/texmf.d
+               install -m 0755 -d $(etctexmf)/fmt.d
+               install -m 0644 debian/20xmltex.cnf $(etctexmf)/texmf.d
+               install -m 0644 debian/40xmltex.cnf $(etctexmf)/fmt.d
                install -m 0755 -d $(sharedir)/base
                install -m 0644 *.xmt xmltex.tex $(sharedir)/base
-               install -m 0755 -d $(sharedir)/templates
-               install -m 0644 debian/*.cnf $(sharedir)/templates
+               install -m 0755 -d $(sharedir)/config
+               install -m 0644 xmltex.cfg $(sharedir)/config
+               install -m 0644 *.ini $(sharedir)/config
 
 distclean:
                rm -f $(addprefix manual.,toc log aux dvi ps)
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer

Reply via email to