[xml/sgml-pkgs] Bug#311557: and yet another minor issue

Don Armstrong Don Armstrong <don@debian.org>, 311557@bugs.debian.org
Wed, 1 Jun 2005 21:58:28 -0700


--UFHRwCdBEJvubb2X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Yet another minor issue, which I found because I had both xmltex.emft
and xmltex.fmt laying about... (probably pathological, but trivial to
fix):


	XMLTEXFMT=$(kpsewhich xmltex.efmt xmltex.fmt) || true
	PDFXMLTEXFMT=$(kpsewhich pdfxmltex.efmt pdfxmltex.fmt) || true
	LOGDIR=$(dirname $(kpsewhich xmltex.efmt xmltex.fmt|head -n 1)) || true
	rm -f $XMLTEXFMT $PDFXMLTEXFMT

	# remove fmt file logs
	rm -f $LOGDIR/xmltex.log $LOGDIR/pdfxmltex.log


Don Armstrong

-- 
America was far better suited to be the World's Movie Star. The
world's tequila-addled pro-league bowler. The world's acerbic bi-polar
stand-up comedian. Anything but a somber and tedious nation of
socially responsible centurions.
 -- Bruce Sterling, _Distraction_ p122

http://www.donarmstrong.com              http://rzlab.ucr.edu

--UFHRwCdBEJvubb2X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="262395_patch.diff"

--- old/xmltex-1.9/debian/postinst	2005-06-01 20:53:42.000000000 -0700
+++ xmltex-1.9/debian/postinst	2005-06-01 20:51:21.000000000 -0700
@@ -105,15 +105,28 @@
     # 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 xmltex.efmt > /dev/null ; then
-        warn "ERROR: XMLTeX memory dump (xmltex.efmt) cannot be found"
+    if ! kpsewhich $xml_fmt > /dev/null ; then
+        warn "ERROR: XMLTeX memory dump ($xml_fmt) cannot be found"
         goterror=true
     fi
-    if ! kpsewhich pdfxmltex.efmt > /dev/null ; then
-        warn "ERROR: PDFXMLTeX memory dump (pdfxmltex.efmt) cannot be found"
+    if ! kpsewhich $pdf_fmt > /dev/null ; then
+        warn "ERROR: PDFXMLTeX memory dump ($pdf_fmt) cannot be found"
         goterror=true
     fi
 
--- old/xmltex-1.9/debian/postrm	2005-06-01 20:53:42.000000000 -0700
+++ xmltex-1.9/debian/postrm	2005-06-01 21:53:06.000000000 -0700
@@ -12,13 +12,13 @@
 
 case "$1" in
     remove)
-	# remove fmt files
-	XMLTEXFMT=$(kpsewhich xmltex.efmt) || true
-	PDFXMLTEXFMT=$(kpsewhich pdfxmltex.efmt) || true
+	# remove fmt and efmt files
+	XMLTEXFMT=$(kpsewhich xmltex.efmt xmltex.fmt) || true
+	PDFXMLTEXFMT=$(kpsewhich pdfxmltex.efmt pdfxmltex.fmt) || true
+	LOGDIR=$(dirname $(kpsewhich xmltex.efmt xmltex.fmt|head -n 1)) || true
 	rm -f $XMLTEXFMT $PDFXMLTEXFMT
 
 	# remove fmt file logs
-	LOGDIR=$(dirname $XMLTEXFMT) || true
 	rm -f $LOGDIR/xmltex.log $LOGDIR/pdfxmltex.log
 
 	# disable conf files

--UFHRwCdBEJvubb2X--