docbook2X-0.8.8-filename_whitespace_handling.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! /bin/sh /usr/share/dpatch/dpatch-run
  2. ## 03_fix_420153_filename_whitespace_handling.dpatch by
  3. ## Daniel Leidert (dale) <daniel.leidert@wgdd.de>
  4. ##
  5. ## All lines beginning with `## DP:' are a description of the patch.
  6. ## DP: Peter Eisentraut reported a regression in the whitespace handling of
  7. ## DP: refentrytitle content during filename creation:
  8. ## DP: http://bugs.debian.org/420153. The problem is, that upstream first
  9. ## DP: replaces all spaces (but not linebreaks btw) with underlines and then
  10. ## DP: it tries to normalize the result. This means, that a linebreak with
  11. ## DP: additional whitespaces results in manpage names like 'foo_ ____bar.9'.
  12. ## DP: So what we basically do in this patch is, that we first normalize the
  13. ## DP: refentrytitle and then replace any spaces left with underlines.
  14. @DPATCH@
  15. diff -urNad docbook2x-0.8.8~/xslt/man/manpage.xsl docbook2x-0.8.8/xslt/man/manpage.xsl
  16. --- docbook2x-0.8.8~/xslt/man/manpage.xsl 2006-04-20 15:45:55.000000000 +0200
  17. +++ docbook2x-0.8.8/xslt/man/manpage.xsl 2007-04-20 16:19:28.000000000 +0200
  18. @@ -30,7 +30,7 @@
  19. <xsl:template name="manpage-filename">
  20. <xsl:param name="filename" />
  21. - <xsl:value-of select="normalize-space(translate($filename, &quot; /&quot;, &quot;__&quot;))" />
  22. + <xsl:value-of select="translate(normalize-space($filename), ' /', '__')" />
  23. </xsl:template>
  24. diff -urNad docbook2x-0.8.8~/xslt/man/refentry.xsl docbook2x-0.8.8/xslt/man/refentry.xsl
  25. --- docbook2x-0.8.8~/xslt/man/refentry.xsl 2006-04-21 04:39:55.000000000 +0200
  26. +++ docbook2x-0.8.8/xslt/man/refentry.xsl 2007-04-20 16:21:53.000000000 +0200
  27. @@ -38,7 +38,11 @@
  28. <xsl:template name="refentry-filename">
  29. <xsl:param name="title" />
  30. - <xsl:variable name="title2" select="translate($title, &quot; /&quot;, &quot;__&quot;)" />
  31. + <xsl:variable name="title2">
  32. + <xsl:call-template name="manpage-filename">
  33. + <xsl:with-param name="filename" select="$title" />
  34. + </xsl:call-template>
  35. + </xsl:variable>
  36. <!-- not using gentext here since man page names tend not to have
  37. accented chars / non-Latin chars ...