Changeset 935c600 for stylesheets/patcheslist.xsl
- Timestamp:
- 01/26/2005 09:33:47 PM (20 years ago)
- Children:
- a65cfb1
- Parents:
- 0fb69dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/patcheslist.xsl
r0fb69dd r935c600 5 5 ]> 6 6 7 <!-- To work against BLFS some changes are needed -->8 9 7 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 10 8 version="1.0"> … … 12 10 <xsl:output method="text"/> 13 11 14 <xsl:param name="links.directory"> 15 <xsl:value-of select="substring-after('&patches-root;', 'patches/')"/> 12 <!-- Allow select the dest dir at runtime --> 13 <xsl:param name="dest.dir"> 14 <xsl:value-of select="concat('/home/httpd/', substring-after('&patches-root;', 'http://'))"/> 16 15 </xsl:param> 17 16 18 17 <xsl:template match="/"> 19 <xsl:text>#! /bin/bash
</xsl:text> 20 <xsl:text>
 cd /home/httpd/</xsl:text> 21 <xsl:value-of select="substring-after('&patches-root;', 'http://')"/> 18 <xsl:text>#! /bin/bash

</xsl:text> 19 <!-- Create dest.dir if it don't exist --> 20 <xsl:text> mkdir -p </xsl:text> 21 <xsl:value-of select="$dest.dir"/> 22 <xsl:text> &&
</xsl:text> 23 <xsl:text> cd </xsl:text> 24 <xsl:value-of select="$dest.dir"/> 22 25 <xsl:text> &&

</xsl:text> 23 <xsl:text> rm -f *.patch &&

</xsl:text> 26 <!-- Touch a dummy patch to prevent fails if dest dir is empty, then remove old patches --> 27 <xsl:text> touch dummy.patch &&
 rm -f *.patch &&

</xsl:text> 24 28 <xsl:apply-templates/> 29 <!-- Ensure correct owneship --> 25 30 <xsl:text>
 chgrp lfswww *.patch &&
</xsl:text> 26 31 <xsl:text>
 exit
</xsl:text> 27 32 </xsl:template> 28 33 29 <xsl:template match="//text()"> 30 <xsl:text/> 31 </xsl:template> 34 <xsl:template match="//text()"/> 32 35 33 36 <xsl:template match="//ulink"> 34 <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')"> 35 <xsl:choose> 36 <xsl:when test="ancestor-or-self::*/@condition = 'pdf'"/> 37 <xsl:otherwise> 38 <xsl:text> cp </xsl:text> 39 <xsl:text>/home/httpd/</xsl:text> 40 <xsl:value-of select="substring-before (substring-after ('&patches-root;', 'http://'), $links.directory)"/> 41 <xsl:text>downloads/</xsl:text> 42 <xsl:if test="contains (@url, '-')"> 43 <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/> 44 <xsl:variable name="links.directory2" select="translate ($links.directory, '0123456789', '2222222222')"/> 45 <xsl:choose> 46 <xsl:when test="contains ($cut, ',')"> 47 <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), ',2')"/> 48 </xsl:when> 49 <xsl:otherwise> 50 <xsl:choose> 51 <xsl:when test="contains ($cut, '-src-2')"> 52 <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-src-2')"/> 53 </xsl:when> 54 <xsl:otherwise> 55 <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-2')"/> 56 </xsl:otherwise> 57 </xsl:choose> 58 </xsl:otherwise> 59 </xsl:choose> 60 </xsl:if> 61 <xsl:text>/</xsl:text> 62 <xsl:value-of select="substring-after(@url, $links.directory)"/> 63 <xsl:text> . 
</xsl:text> 64 </xsl:otherwise> 65 </xsl:choose> 37 <!-- Match only local patches links and skip duplicated URLs splitted for PDF output--> 38 <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;') 39 and not(ancestor-or-self::*/@condition = 'pdf')"> 40 <xsl:variable name="patch.name" select="substring-after(@url, '&patches-root;')"/> 41 <xsl:variable name="cut" 42 select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/> 43 <xsl:variable name="patch.name2"> 44 <xsl:value-of select="substring-before($patch.name, '-')"/> 45 <xsl:text>-</xsl:text> 46 <xsl:value-of select="$cut"/> 47 </xsl:variable> 48 <xsl:text> cp /home/httpd/www.linuxfromscratch.org/patches/downloads/</xsl:text> 49 <xsl:value-of select="substring-before($patch.name2, '-0')"/> 50 <xsl:text>/</xsl:text> 51 <xsl:value-of select="$patch.name"/> 52 <xsl:text> . 
</xsl:text> 66 53 </xsl:if> 67 54 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.