patcheslist.xsl 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!-- This work against BLFS also -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. version="1.0">
  5. <xsl:output method="text"/>
  6. <xsl:param name="links.directory">lfs/cvs/unstable/</xsl:param>
  7. <xsl:param name="deep.to.downloads">../../../</xsl:param>
  8. <xsl:template match="/">
  9. <xsl:text>#! /bin/bash
  10. cd /home/httpd/www.linuxfromscratch.org/patches/</xsl:text>
  11. <xsl:value-of select="$links.directory"/>
  12. <xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
  13. <xsl:text> rm -f *.patch &amp;&amp;&#x0a;&#x0a;</xsl:text>
  14. <xsl:apply-templates/>
  15. <xsl:text>&#x0a; exit</xsl:text>
  16. </xsl:template>
  17. <xsl:template match="//text()">
  18. <xsl:text/>
  19. </xsl:template>
  20. <xsl:template match="//ulink">
  21. <xsl:if test="contains(@url, '.patch') and contains(@url, 'linuxfromscratch')">
  22. <xsl:text> cp </xsl:text>
  23. <xsl:value-of select="$deep.to.downloads"/>
  24. <xsl:text>downloads/</xsl:text>
  25. <xsl:if test="contains (@url, '-')">
  26. <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/>
  27. <xsl:choose>
  28. <xsl:when test="contains ($cut, ',')">
  29. <xsl:value-of select="substring-before (substring-after($cut, $links.directory), ',2')"/>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <xsl:value-of select="substring-before (substring-after($cut, $links.directory), '-2')"/>
  33. </xsl:otherwise>
  34. </xsl:choose>
  35. </xsl:if>
  36. <xsl:text>/</xsl:text>
  37. <xsl:value-of select="substring-after(@url, $links.directory)"/>
  38. <xsl:text> . &amp;&amp;&#x0a;</xsl:text>
  39. </xsl:if>
  40. </xsl:template>
  41. </xsl:stylesheet>