source: stylesheets/patcheslist.xsl@ bce3ed57

10.0 10.1 11.0 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since bce3ed57 was bce3ed57, checked in by Bruce Dubbs <bdubbs@…>, 16 years ago

Update to xml to create copy patches script

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

  • Property mode set to 100644
File size: 3.3 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 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('/home/httpd/', substring-after('&patch-root;', 'http://'))"/>
22 </xsl:param>
23
24 <xsl:template match="/">
25 <xsl:text>#! /bin/bash&#x0a;&#x0a;</xsl:text>
26 <xsl:text>function copy
27{
28 cp $1 $2 >>copyerrs 2>&amp;1
29}&#x0a;&#x0a;</xsl:text>
30 <!-- Create dest.dir if it don't exist -->
31 <xsl:text>mkdir -p </xsl:text>
32 <xsl:value-of select="$dest.dir"/>
33 <xsl:text> &amp;&amp;&#x0a;</xsl:text>
34 <xsl:text>cd </xsl:text>
35 <xsl:value-of select="$dest.dir"/>
36 <xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
37 <!-- Remove old patches and possible list of missing patches-->
38 <xsl:text>rm -f *.patch copyerrs &amp;&amp;&#x0a;&#x0a;</xsl:text>
39 <xsl:apply-templates/>
40 <!-- Ensure correct ownership -->
41 <xsl:text>&#x0a;chgrp lfswww *.patch &amp;&amp;&#x0a;</xsl:text>
42 <xsl:text>if [ `wc -l copyerrs|sed 's/ *//' |cut -f1 -d' '` -gt 0 ]; then
43 mail -s "Missing BLFS patches" blfs-book@linuxfromscratch.org &lt; copyerrs
44fi</xsl:text>
45 <xsl:text>&#x0a;exit&#x0a;</xsl:text>
46 </xsl:template>
47
48 <xsl:template match="//text()"/>
49
50 <xsl:template match="//ulink">
51 <!-- Match only local patches links and skip duplicated URLs splitted for PDF output-->
52 <xsl:if test="contains(@url, '.patch') and contains(@url, '&patch-root;')
53 and not(ancestor-or-self::*/@condition = 'pdf')">
54 <xsl:variable name="patch.name" select="substring-after(@url, '&patch-root;')"/>
55 <xsl:text>copy /home/httpd/www.linuxfromscratch.org/patches/downloads</xsl:text>
56 <xsl:choose>
57 <!-- cdparanoia -->
58 <xsl:when test="contains($patch.name, '-III')">
59 <xsl:text>/cdparanoia</xsl:text>
60 </xsl:when>
61 <!-- Open Office -->
62 <xsl:when test="contains($patch.name, 'OOo')">
63 <xsl:text>/OOo</xsl:text>
64 </xsl:when>
65 <!-- QT -->
66 <xsl:when test="contains($patch.name, 'qt-x')">
67 <xsl:text>/qt</xsl:text>
68 </xsl:when>
69 <!-- XOrg -->
70 <xsl:when test="contains($patch.name, 'X11R6')">
71 <xsl:text>/xorg</xsl:text>
72 </xsl:when>
73 <!-- General rule -->
74 <xsl:otherwise>
75 <xsl:variable name="cut"
76 select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
77 <xsl:variable name="patch.name2">
78 <xsl:value-of select="substring-before($patch.name, '-')"/>
79 <xsl:text>-</xsl:text>
80 <xsl:value-of select="$cut"/>
81 </xsl:variable>
82 <xsl:value-of select="substring-before($patch.name2, '-0')"/>
83 </xsl:otherwise>
84 </xsl:choose>
85 <xsl:value-of select="$patch.name"/>
86 <xsl:text> . &#x0a;</xsl:text>
87 </xsl:if>
88 </xsl:template>
89
90</xsl:stylesheet>
91
Note: See TracBrowser for help on using the repository browser.