source: stylesheets/patcheslist.xsl@ bd9549b6

7.6-blfs 7.6-systemd kde5-14686 systemd-13485
Last change on this file since bd9549b6 was 8b55d031, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Fixup extraction of net-tools patch directory

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@12809 af4574ff-66df-0310-9fd7-8a98e5e911e0

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