source: stylesheets/patcheslist.xsl

trunk
Last change on this file was 2a26a4f5, checked in by Pierre Labastie <pierre.labastie@…>, 3 months ago

Remove all &#xxx; occurences

  • replace some characters by their utf-8 encoded equivalent (and change encoding in the <?xml?> line
  • replace &#xa; with a true newline char. This is somewhat more readable anyway.
  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[2a26a4f5]1<?xml version='1.0' encoding='UTF-8'?>
[afa7fb1]2<!DOCTYPE xsl:stylesheet [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
[ded6ddd]6
7<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8 version="1.0">
9
[a9e89d0]10 <xsl:output method="text"/>
[ded6ddd]11
[dcb91d8]12 <!-- Allow select the dest dir at runtime -->
13 <xsl:param name="dest.dir">
[0f7d4cb]14 <xsl:value-of select="concat('/srv/www/', substring-after('&patches-root;', 'https://'))"/>
[afa7fb1]15 </xsl:param>
[07f719a]16
17 <xsl:template match="/">
[3bf7cb6]18 <xsl:text>#! /bin/bash
19
20function copy
21{
22 cp $1 $2 >>copyerrs 2>&amp;1
23}
24
[2a26a4f5]25umask 002
[2159d60]26
[2a26a4f5]27# Create dest.dir if it doesn't exist
28# Remove old patches
29# Copy the patches
30# Ensure correct ownership
31install -d -m 775 -g lfswww </xsl:text>
[dcb91d8]32 <xsl:value-of select="$dest.dir"/>
[2a26a4f5]33 <xsl:text> &amp;&amp;
34cd </xsl:text>
[dcb91d8]35 <xsl:value-of select="$dest.dir"/>
[2a26a4f5]36 <xsl:text> &amp;&amp;
37rm -f *.patch copyerrs &amp;&amp;
38
39</xsl:text>
[07f719a]40 <xsl:apply-templates/>
[3bf7cb6]41 <xsl:text>
[2a26a4f5]42chgrp lfswww *.patch &amp;&amp;
[3bf7cb6]43if [ `wc -l copyerrs | sed 's/ *//' | cut -f1 -d' '` -gt 0 ]; then
[7a8a136]44 mail -s "Missing LFS patches" lfs-book@lists.linuxfromscratch.org &lt; copyerrs
[2a26a4f5]45fi
[2159d60]46
[2a26a4f5]47exit
48</xsl:text>
[07f719a]49 </xsl:template>
50
[dcb91d8]51 <xsl:template match="//text()"/>
[ded6ddd]52
[a9e89d0]53 <xsl:template match="//ulink">
[dcb91d8]54 <!-- Match only local patches links and skip duplicated URLs splitted for PDF output-->
[2159d60]55 <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')
[dcb91d8]56 and not(ancestor-or-self::*/@condition = 'pdf')">
57 <xsl:variable name="patch.name" select="substring-after(@url, '&patches-root;')"/>
[2159d60]58 <xsl:variable name="cut"
[dcb91d8]59 select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
60 <xsl:variable name="patch.name2">
61 <xsl:value-of select="substring-before($patch.name, '-')"/>
62 <xsl:text>-</xsl:text>
63 <xsl:value-of select="$cut"/>
64 </xsl:variable>
[2159d60]65 <xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads/</xsl:text>
[2a26a4f5]66 <xsl:value-of select="substring-before($patch.name2, '-0')"/>
[dcb91d8]67 <xsl:text>/</xsl:text>
68 <xsl:value-of select="$patch.name"/>
[2a26a4f5]69 <xsl:text> .
70</xsl:text>
[a9e89d0]71 </xsl:if>
72 </xsl:template>
[ded6ddd]73
74</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.