patcheslist.xsl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!DOCTYPE xsl:stylesheet [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <!-- To work against BLFS some changes are needed -->
  7. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. version="1.0">
  9. <xsl:output method="text"/>
  10. <xsl:param name="links.directory">
  11. <xsl:value-of select="substring-after('&patches-root;', 'patches/')"/>
  12. </xsl:param>
  13. <xsl:template match="/">
  14. <xsl:text>#! /bin/bash&#x0a;</xsl:text>
  15. <xsl:text>&#x0a; cd /home/httpd/</xsl:text>
  16. <xsl:value-of select="substring-after('&patches-root;', 'http://')"/>
  17. <xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
  18. <xsl:text> rm -f *.patch &amp;&amp;&#x0a;&#x0a;</xsl:text>
  19. <xsl:apply-templates/>
  20. <xsl:text>&#x0a; chgrp lfswww *.patch &amp;&amp;&#x0a;</xsl:text>
  21. <xsl:text>&#x0a; exit&#x0a;</xsl:text>
  22. </xsl:template>
  23. <xsl:template match="//text()">
  24. <xsl:text/>
  25. </xsl:template>
  26. <xsl:template match="//ulink">
  27. <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')">
  28. <xsl:choose>
  29. <xsl:when test="ancestor-or-self::*/@condition = 'pdf'"/>
  30. <xsl:otherwise>
  31. <xsl:text> cp </xsl:text>
  32. <xsl:text>/home/httpd/</xsl:text>
  33. <xsl:value-of select="substring-before (substring-after ('&patches-root;', 'http://'), $links.directory)"/>
  34. <xsl:text>downloads/</xsl:text>
  35. <xsl:if test="contains (@url, '-')">
  36. <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/>
  37. <xsl:variable name="links.directory2" select="translate ($links.directory, '0123456789', '2222222222')"/>
  38. <xsl:choose>
  39. <xsl:when test="contains ($cut, ',')">
  40. <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), ',2')"/>
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <xsl:choose>
  44. <xsl:when test="contains ($cut, '-src-2')">
  45. <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-src-2')"/>
  46. </xsl:when>
  47. <xsl:otherwise>
  48. <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-2')"/>
  49. </xsl:otherwise>
  50. </xsl:choose>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:if>
  54. <xsl:text>/</xsl:text>
  55. <xsl:value-of select="substring-after(@url, $links.directory)"/>
  56. <xsl:text> . &#x0a;</xsl:text>
  57. </xsl:otherwise>
  58. </xsl:choose>
  59. </xsl:if>
  60. </xsl:template>
  61. </xsl:stylesheet>