Your message dated Mon, 09 Mar 2009 17:20:11 +0000
with message-id <[email protected]>
and subject line Bug#518907: fixed in xmlto 0.0.21-5
has caused the Debian Bug report #518907,
regarding xmlto litters /tmp with xmlto-xsl.* files
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
518907: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518907
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xmlto
Version: 0.0.21-4
Tags: patch

Building git-core results in around 150 xmlto-xsl.* files in /tmp with
content like
       <?xml version='1.0'?>
       <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                       version='1.0'>
       <xsl:param name="page.height">279.4mm</xsl:param>
       <xsl:param name="page.width">215.9mm</xsl:param>
       ...

Probably this is because of xmlto.in, line 108:
       papersizemod=$(${MKTEMP} ${TMPDIR:-/tmp}/@[email protected])
which creates a file that, once xmlto_libpaper_173090.dpatch has been
applied, will never be added to CLEANFILES.

A patch analogous to xmlto_libpaper_173090.dpatch should work.

On the other hand, it seems that if mktemp fails, xmlto will not
handle it very gracefully. In some cases (as with the libpaper patch),
the program will plunge on unaware, eventually producing an error due
to the missing filename. In others cases, xmlto will exit immediately
without explaining why. So I would prefer something like the attached
patch. It also has the advantage of making it harder to regress to
this bug's behavior again.

Tested by rebuilding git-core. The mktemp failure handling can be
tested by setting TMPDIR to some ridiculous value.

Thanks,
Jonathan
diff --git a/xmlto.in b/xmlto.in
index 24ba478..067f127 100755
--- a/xmlto.in
+++ b/xmlto.in
@@ -68,6 +68,31 @@ EOF
   fi
 }
 
+# make_temp [-d] filenametag varname [message upon failure]
+#
+# Wrapper for 'varname=$(mktemp /tmp/xmlto-$filenametag.XXXXXX)'.
+#  * Remembers the temporary file's name so it can be deleted on exit
+#  * If the failure message is empty or missing, exits on failure
+make_temp () {
+  local dirflag="" prefix="@PACKAGE@"
+  [ "$1" = "-d" ] && { dirflag="-d"; shift; }
+  [ -n "$1" ] && prefix="@pack...@-$1"
+
+  if eval $2='$(${MKTEMP} $dirflag "${TMPDIR:-/tmp}/${prefix}.XXXXXX")'
+  then
+    eval 'CLEANFILES[$CLEANFILE_COUNT]="${'$2'}"'
+    CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
+    return 0
+  elif [ -z "$3" ]
+  then
+    echo >&2 "mktemp failed!"
+    exit 1
+  else
+    echo >&2 "mktemp failed. $3"
+    return 1
+  fi
+}
+
 # Allow FORMAT_DIR to be over-ridden, so that we can be
 # run from the build directory.
 pref...@prefix@
@@ -105,7 +130,7 @@ then
 
   if [ -n "$paperheight" -a -n "$paperwidth" ]
   then
-    papersizemod=$(${MKTEMP} ${TMPDIR:-/tmp}/@[email protected])
+    make_temp xsl papersizemod "Using default paper type." &&
     cat << EOF > "$papersizemod"
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -139,7 +164,7 @@ then
 
   if [ -n "$papertype" ]
   then
-    papersizemod=$(${MKTEMP} ${TMPDIR:-/tmp}/@[email protected])
+    make_temp xsl papersizemod "Using default paper type." &&
     cat << EOF > "$papersizemod"
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -157,10 +182,9 @@ then
 
   if [ -n "$charmap" ]
   then
-    encodingmod=$(${MKTEMP} ${TMPDIR:-/tmp}/@[email protected])
-    CLEANFILES[$CLEANFILE_COUNT]="$encodingmod"
-    CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
-    cat << EOF > "$encodingmod"
+    if make_temp xsl encodingmod "Using default output encoding."
+    then
+      cat << EOF > "$encodingmod"
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 version='1.0'>
@@ -168,8 +192,9 @@ then
 <xsl:param name="man.charmap.use.subset" select="'0'"/>
 </xsl:stylesheet>
 EOF
-    XSL_MODS[$XSL_MOD_COUNT]="$encodingmod"
-    XSL_MOD_COUNT=$(($XSL_MOD_COUNT + 1))
+      XSL_MODS[$XSL_MOD_COUNT]="$encodingmod"
+      XSL_MOD_COUNT=$(($XSL_MOD_COUNT + 1))
+    fi
   fi
 fi
 
@@ -216,9 +241,7 @@ while [ "$#" -gt "0" ]; do
        ;;
   -x)
        case "$2" in
-       -)  TMP_STYLESHEET="$(${MKTEMP} 
${TMPDIR:-/tmp}/@[email protected])" || exit 1
-           CLEANFILES[$CLEANFILE_COUNT]="$TMP_STYLESHEET"
-           CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
+       -)  make_temp stdin-xsl TMP_STYLESHEET
            cat /dev/stdin > ${TMP_STYLESHEET}
            STYLESHEET=${TMP_STYLESHEET} ;;
        /*) STYLESHEET="$2" ;;
@@ -337,8 +360,6 @@ case "$DEST_FORMAT" in
   fo | pdf | ps | dvi)
     if [ -n "$papersizemod" ]
     then
-      CLEANFILES[$CLEANFILE_COUNT]="$papersizemod"
-      CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
       XSL_MODS[$XSL_MOD_COUNT]="$papersizemod"
       XSL_MOD_COUNT=$(($XSL_MOD_COUNT + 1))
     fi
@@ -393,9 +414,7 @@ if [ "$XSL_MOD_COUNT" -gt "0" -a -n "$STYLESHEET" ]
 then
   REAL_STYLESHEET="$STYLESHEET"
   [ "$VERBOSE" -ge 1 ] && echo >&2 "Real stylesheet: ${REAL_STYLESHEET}"
-  STYLESHEET="$(${MKTEMP} ${TMPDIR:-/tmp}/@[email protected])" || exit 1
-  CLEANFILES[$CLEANFILE_COUNT]="$STYLESHEET"
-  CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
+  make_temp xsl STYLESHEET
   cat << EOF > "$STYLESHEET"
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -417,9 +436,7 @@ EOF
 EOF
 fi
 
-XSLT_PROCESSED_DIR="$(${MKTEMP} -d ${TMPDIR:-/tmp}/@[email protected])" || exit 1
-CLEANFILES[$CLEANFILE_COUNT]="$XSLT_PROCESSED_DIR"
-CLEANFILE_COUNT=$(($CLEANFILE_COUNT + 1))
+make_temp -d "" XSLT_PROCESSED_DIR
 cd "$XSLT_PROCESSED_DIR"
 
 # Validate the input

--- End Message ---
--- Begin Message ---
Source: xmlto
Source-Version: 0.0.21-5

We believe that the bug you reported is fixed in the latest version of
xmlto, which is due to be installed in the Debian FTP archive:

xmlto_0.0.21-5.diff.gz
  to pool/main/x/xmlto/xmlto_0.0.21-5.diff.gz
xmlto_0.0.21-5.dsc
  to pool/main/x/xmlto/xmlto_0.0.21-5.dsc
xmlto_0.0.21-5_i386.deb
  to pool/main/x/xmlto/xmlto_0.0.21-5_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Leidert (dale) <[email protected]> (supplier of updated xmlto 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 09 Mar 2009 14:10:33 +0100
Source: xmlto
Binary: xmlto
Architecture: source i386
Version: 0.0.21-5
Distribution: unstable
Urgency: low
Maintainer: Debian XML/SGML Group <[email protected]>
Changed-By: Daniel Leidert (dale) <[email protected]>
Description: 
 xmlto      - XML-to-any converter
Closes: 518907
Changes: 
 xmlto (0.0.21-5) unstable; urgency=low
 .
   * debian/control (Vcs-Browser, Vcs-Svn): Adjusted and fixed URLs.
     (Recommends): Added dblatex.
     (Suggests): Removed obsolete passivetex.
     (Description): Applied update to mention all supported toolchains
     and their limitations.
   * debian/patches/xmlto_libpaper_173090.dpatch: Adjusted.
     - xmlto.in: Another regression fix: Remove papersizemod-XSL in
       paperconf-scenario (closes: #518907). Thanks to Jonathan Nieder
       for the report.
Checksums-Sha1: 
 f093f4c4f618b30175db50c0c529d692531400e9 1357 xmlto_0.0.21-5.dsc
 cb2dc8f57101c93ea565dc010929d6e9273c8eb7 9035 xmlto_0.0.21-5.diff.gz
 dde2e10f63aba6626038da8d41f1c3c918f53b3e 35840 xmlto_0.0.21-5_i386.deb
Checksums-Sha256: 
 313ebe46dd91f22928b38f388c2619997d399959db44f35c200625dc7bfd82d1 1357 
xmlto_0.0.21-5.dsc
 add71a6f68293912c524a65943db288feebd15ba0d19cee22c89d2dfe4e7b6cc 9035 
xmlto_0.0.21-5.diff.gz
 574691abc310b3d87b670c823cb09a6094c318d1e2060a8550c7904e326c6cc5 35840 
xmlto_0.0.21-5_i386.deb
Files: 
 8bdae4f265ab1036a5e64c9654591799 1357 text optional xmlto_0.0.21-5.dsc
 902f72e8c74815315fe458137ff9aa5b 9035 text optional xmlto_0.0.21-5.diff.gz
 295cf823645944f88e31898414b6d00d 35840 text optional xmlto_0.0.21-5_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkm1TdsACgkQm0bx+wiPa4wtfACgkgl+8F/SEHgDN64HFKr8TVWz
th8AoKUF9BcawjpljtnQQjUc1FS3/H4o
=/xgt
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to