[a804944] | 1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
[967e951] | 2 | <!DOCTYPE xsl:stylesheet [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[71fc777d] | 6 |
|
---|
[6091daf] | 7 | <!--
|
---|
[bce3ed57] | 8 | This stylesheet creates a script to copy the patches referenced
|
---|
| 9 | in the BLFS book from the patches repository to the blfs
|
---|
[6091daf] | 10 | download area. It is very specific to the installation on
|
---|
[bce3ed57] | 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">
|
---|
[47be4efc] | 21 | <xsl:value-of select="concat('/srv/www/', substring-after('&patch-root;', 'https://'))"/>
|
---|
[967e951] | 22 | </xsl:param>
|
---|
| 23 |
|
---|
| 24 | <xsl:template match="/">
|
---|
[a804944] | 25 | <xsl:text>#! /bin/bash
|
---|
| 26 |
|
---|
| 27 | function copy
|
---|
[bce3ed57] | 28 | {
|
---|
| 29 | cp $1 $2 >>copyerrs 2>&1
|
---|
[a804944] | 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 |
|
---|
| 37 | mkdir -p </xsl:text>
|
---|
[967e951] | 38 | <xsl:value-of select="$dest.dir"/>
|
---|
[a804944] | 39 | <xsl:text> &&
|
---|
| 40 | cd </xsl:text>
|
---|
[967e951] | 41 | <xsl:value-of select="$dest.dir"/>
|
---|
[a804944] | 42 | <xsl:text> &&
|
---|
| 43 |
|
---|
| 44 | rm -f *.patch copyerrs &&
|
---|
| 45 |
|
---|
| 46 | </xsl:text>
|
---|
[967e951] | 47 | <xsl:apply-templates/>
|
---|
[a804944] | 48 | <xsl:text>
|
---|
| 49 | chgrp lfswww *.patch &&
|
---|
| 50 | if [ `wc -l copyerrs|sed 's/ *//' |cut -f1 -d' '` -gt 0 ]; then
|
---|
[70c1211] | 51 | mail -s "Missing BLFS patches" blfs-book@lists.linuxfromscratch.org < copyerrs
|
---|
[a804944] | 52 | fi
|
---|
| 53 | exit</xsl:text>
|
---|
[71fc777d] | 54 | </xsl:template>
|
---|
| 55 |
|
---|
[967e951] | 56 | <xsl:template match="//text()"/>
|
---|
| 57 |
|
---|
[71fc777d] | 58 | <xsl:template match="//ulink">
|
---|
[0f27fb5] | 59 | <!-- Match only local patches links and skip duplicated URLs split for PDF output-->
|
---|
[6091daf] | 60 | <xsl:if test="contains(@url, '.patch') and contains(@url, '&patch-root;')
|
---|
[967e951] | 61 | and not(ancestor-or-self::*/@condition = 'pdf')">
|
---|
| 62 | <xsl:variable name="patch.name" select="substring-after(@url, '&patch-root;')"/>
|
---|
[b0965de] | 63 | <xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads</xsl:text>
|
---|
[967e951] | 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>
|
---|
[8b55d031] | 80 | </xsl:when>
|
---|
| 81 | <!-- net-tools -->
|
---|
| 82 | <xsl:when test="contains($patch.name, 'net-tools')">
|
---|
| 83 | <xsl:text>/net-tools</xsl:text>
|
---|
[bc3071d7] | 84 | </xsl:when>
|
---|
| 85 | <!-- junit -->
|
---|
| 86 | <xsl:when test="contains($patch.name, 'junit')">
|
---|
| 87 | <xsl:text>/junit</xsl:text>
|
---|
[333a1e69] | 88 | </xsl:when>
|
---|
| 89 | <!-- x265 -->
|
---|
| 90 | <xsl:when test="contains($patch.name, 'x265')">
|
---|
| 91 | <xsl:text>/x265</xsl:text>
|
---|
[60b2296] | 92 | </xsl:when>
|
---|
| 93 | <!-- node -->
|
---|
| 94 | <xsl:when test="contains($patch.name, 'node')">
|
---|
| 95 | <xsl:text>/node</xsl:text>
|
---|
[3e0cd17] | 96 | </xsl:when>
|
---|
| 97 | <!-- nss -->
|
---|
[b084804] | 98 | <xsl:when test="contains($patch.name, 'nss-standalone')">
|
---|
[3e0cd17] | 99 | <xsl:text>/nss</xsl:text>
|
---|
[967e951] | 100 | </xsl:when>
|
---|
| 101 | <!-- General rule -->
|
---|
| 102 | <xsl:otherwise>
|
---|
[6091daf] | 103 | <xsl:variable name="cut"
|
---|
[967e951] | 104 | select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
|
---|
| 105 | <xsl:variable name="patch.name2">
|
---|
| 106 | <xsl:value-of select="substring-before($patch.name, '-')"/>
|
---|
| 107 | <xsl:text>-</xsl:text>
|
---|
| 108 | <xsl:value-of select="$cut"/>
|
---|
| 109 | </xsl:variable>
|
---|
| 110 | <xsl:value-of select="substring-before($patch.name2, '-0')"/>
|
---|
| 111 | </xsl:otherwise>
|
---|
| 112 | </xsl:choose>
|
---|
| 113 | <xsl:value-of select="$patch.name"/>
|
---|
[2a2f7d9] | 114 | <xsl:text> .
</xsl:text>
|
---|
[71fc777d] | 115 | </xsl:if>
|
---|
| 116 | </xsl:template>
|
---|
| 117 |
|
---|
[2555778] | 118 | </xsl:stylesheet>
|
---|
| 119 |
|
---|