source: stylesheets/patcheslist.xsl@ b0965de

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since b0965de was b0965de, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Update XSL script to copy patches for new server

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

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[71fc777d]1<?xml version='1.0' encoding='ISO-8859-1'?>
[967e951]2<!DOCTYPE xsl:stylesheet [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
[71fc777d]6
[bce3ed57]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
[71fc777d]14<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
15 version="1.0">
16
17 <xsl:output method="text"/>
18
[967e951]19 <!-- Allow select the dest dir at runtime -->
20 <xsl:param name="dest.dir">
[b0965de]21 <xsl:value-of select="concat('/srv/www/', substring-after('&patch-root;', 'http://'))"/>
[967e951]22 </xsl:param>
23
24 <xsl:template match="/">
25 <xsl:text>#! /bin/bash&#x0a;&#x0a;</xsl:text>
[bce3ed57]26 <xsl:text>function copy
27{
28 cp $1 $2 >>copyerrs 2>&amp;1
29}&#x0a;&#x0a;</xsl:text>
[967e951]30 <!-- Create dest.dir if it don't exist -->
[bce3ed57]31 <xsl:text>mkdir -p </xsl:text>
[967e951]32 <xsl:value-of select="$dest.dir"/>
33 <xsl:text> &amp;&amp;&#x0a;</xsl:text>
[bce3ed57]34 <xsl:text>cd </xsl:text>
[967e951]35 <xsl:value-of select="$dest.dir"/>
36 <xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
[bce3ed57]37 <!-- Remove old patches and possible list of missing patches-->
38 <xsl:text>rm -f *.patch copyerrs &amp;&amp;&#x0a;&#x0a;</xsl:text>
[967e951]39 <xsl:apply-templates/>
[bce3ed57]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>
[71fc777d]46 </xsl:template>
47
[967e951]48 <xsl:template match="//text()"/>
49
[71fc777d]50 <xsl:template match="//ulink">
[967e951]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;')"/>
[b0965de]55 <xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads</xsl:text>
[967e951]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>
[71fc777d]87 </xsl:if>
88 </xsl:template>
89
[2555778]90</xsl:stylesheet>
91
Note: See TracBrowser for help on using the repository browser.