source: stylesheets/patcheslist.xsl

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

Replace some utf-8 encoded chars with char entities

It has been said that some chars were not readable as utf-8.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE xsl:stylesheet [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6
7<!--
8 This stylesheet creates a script to copy the patches referenced
9 in the BLFS book from the patches repository to the blfs
10 download area. It is very specific to the installation on
11 the home server.
12-->
13
14<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
15 version="1.0">
16
17 <xsl:output method="text"/>
18
19 <!-- Allow select the dest dir at runtime -->
20 <xsl:param name="dest.dir">
21 <xsl:value-of select="concat('/srv/www/', substring-after('&patch-root;', 'https://'))"/>
22 </xsl:param>
23
24 <xsl:template match="/">
25 <xsl:text>#! /bin/bash
26
27function copy
28{
29 cp $1 $2 >>copyerrs 2>&amp;1
30}
31
32# Create dest.dir if it doesn't exist
33# Change to it
34# Remove old patches and possible list of missing patches
35# Ensure correct ownership
36
37mkdir -p </xsl:text>
38 <xsl:value-of select="$dest.dir"/>
39 <xsl:text> &amp;&amp;
40cd </xsl:text>
41 <xsl:value-of select="$dest.dir"/>
42 <xsl:text> &amp;&amp;
43
44 rm -f *.patch copyerrs &amp;&amp;
45
46</xsl:text>
47 <xsl:apply-templates/>
48 <xsl:text>
49chgrp lfswww *.patch &amp;&amp;
50if [ `wc -l copyerrs|sed 's/ *//' |cut -f1 -d' '` -gt 0 ]; then
51 mail -s "Missing BLFS patches" blfs-book@lists.linuxfromscratch.org &lt; copyerrs
52fi
53exit</xsl:text>
54 </xsl:template>
55
56 <xsl:template match="//text()"/>
57
58 <xsl:template match="//ulink">
59 <!-- Match only local patches links and skip duplicated URLs splitted for PDF output-->
60 <xsl:if test="contains(@url, '.patch') and contains(@url, '&patch-root;')
61 and not(ancestor-or-self::*/@condition = 'pdf')">
62 <xsl:variable name="patch.name" select="substring-after(@url, '&patch-root;')"/>
63 <xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads</xsl:text>
64 <xsl:choose>
65 <!-- cdparanoia -->
66 <xsl:when test="contains($patch.name, '-III')">
67 <xsl:text>/cdparanoia</xsl:text>
68 </xsl:when>
69 <!-- Open Office -->
70 <xsl:when test="contains($patch.name, 'OOo')">
71 <xsl:text>/OOo</xsl:text>
72 </xsl:when>
73 <!-- QT -->
74 <xsl:when test="contains($patch.name, 'qt-x')">
75 <xsl:text>/qt</xsl:text>
76 </xsl:when>
77 <!-- XOrg -->
78 <xsl:when test="contains($patch.name, 'X11R6')">
79 <xsl:text>/xorg</xsl:text>
80 </xsl:when>
81 <!-- net-tools -->
82 <xsl:when test="contains($patch.name, 'net-tools')">
83 <xsl:text>/net-tools</xsl:text>
84 </xsl:when>
85 <!-- junit -->
86 <xsl:when test="contains($patch.name, 'junit')">
87 <xsl:text>/junit</xsl:text>
88 </xsl:when>
89 <!-- x265 -->
90 <xsl:when test="contains($patch.name, 'x265')">
91 <xsl:text>/x265</xsl:text>
92 </xsl:when>
93 <!-- node -->
94 <xsl:when test="contains($patch.name, 'node')">
95 <xsl:text>/node</xsl:text>
96 </xsl:when>
97 <!-- General rule -->
98 <xsl:otherwise>
99 <xsl:variable name="cut"
100 select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
101 <xsl:variable name="patch.name2">
102 <xsl:value-of select="substring-before($patch.name, '-')"/>
103 <xsl:text>-</xsl:text>
104 <xsl:value-of select="$cut"/>
105 </xsl:variable>
106 <xsl:value-of select="substring-before($patch.name2, '-0')"/>
107 </xsl:otherwise>
108 </xsl:choose>
109 <xsl:value-of select="$patch.name"/>
110 <xsl:text> .&#xA;</xsl:text>
111 </xsl:if>
112 </xsl:template>
113
114</xsl:stylesheet>
115
Note: See TracBrowser for help on using the repository browser.