docbook2X-0.8.8-error_on_missing_refentry.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/sh /usr/share/dpatch/dpatch-run
  2. ## 05_fix_439214_error_on_missing_refentry.dpatch by Daniel Leidert <daniel.leidert@wgdd.de>
  3. ##
  4. ## All lines beginning with `## DP:' are a description of the patch.
  5. ## DP: If there is no refentry element, the manpage stylesheets silently
  6. ## DP: "ignores" this. It has been requested to print at least a
  7. ## DP: warning.
  8. ## DP:
  9. ## DP: <URL:http://bugs.debian.org/439214>
  10. ## DP: <URL:http://lists.gnu.org/archive/html/groff/2007-11/msg00023.html>
  11. @DPATCH@
  12. diff -urNad trunk~/xslt/man/docbook.xsl trunk/xslt/man/docbook.xsl
  13. --- trunk~/xslt/man/docbook.xsl 2006-04-11 21:00:19.000000000 +0200
  14. +++ trunk/xslt/man/docbook.xsl 2008-02-05 03:31:48.000000000 +0100
  15. @@ -111,11 +111,15 @@
  16. <xsl:when test="child::refentry">
  17. <xsl:apply-templates />
  18. </xsl:when>
  19. -
  20. - <xsl:otherwise>
  21. + <xsl:when test="descendant-or-self::refentry">
  22. <manpageset>
  23. <xsl:apply-templates select="descendant-or-self::refentry" />
  24. </manpageset>
  25. + </xsl:when>
  26. + <xsl:otherwise>
  27. + <xsl:message terminate="no">
  28. + <xsl:text>WARNING: Sorry, but I cannot find a refentry element in your source!</xsl:text>
  29. + </xsl:message>
  30. </xsl:otherwise>
  31. </xsl:choose>
  32. </xsl:template>