2004-05-08 15:19:53 +01:00
|
|
|
<?xml version='1.0' encoding='ISO-8859-1'?>
|
2004-08-13 21:22:01 +01:00
|
|
|
<!DOCTYPE xsl:stylesheet [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2004-05-08 15:19:53 +01:00
|
|
|
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
version="1.0">
|
|
|
|
|
2004-05-19 21:16:58 +01:00
|
|
|
<xsl:output method="text"/>
|
2004-05-08 15:19:53 +01:00
|
|
|
|
2005-01-26 21:32:52 +00:00
|
|
|
<!-- Allow select the dest dir at runtime -->
|
|
|
|
<xsl:param name="dest.dir">
|
2021-05-06 11:04:15 +01:00
|
|
|
<xsl:value-of select="concat('/srv/www/', substring-after('&patches-root;', 'https://'))"/>
|
2004-08-13 21:22:01 +01:00
|
|
|
</xsl:param>
|
2004-05-31 21:15:52 +01:00
|
|
|
|
|
|
|
<xsl:template match="/">
|
2006-02-14 20:18:58 +00:00
|
|
|
<xsl:text>#! /bin/bash
|
|
|
|
|
|
|
|
function copy
|
|
|
|
{
|
|
|
|
cp $1 $2 >>copyerrs 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
umask 002 

</xsl:text>
|
2006-12-20 10:07:39 +00:00
|
|
|
|
2005-01-26 21:32:52 +00:00
|
|
|
<!-- Create dest.dir if it don't exist -->
|
2006-02-14 20:18:58 +00:00
|
|
|
<xsl:text>install -d -m 775 -g lfswww </xsl:text>
|
2005-01-26 21:32:52 +00:00
|
|
|
<xsl:value-of select="$dest.dir"/>
|
|
|
|
<xsl:text> &&
</xsl:text>
|
2006-02-14 20:18:58 +00:00
|
|
|
<xsl:text>cd </xsl:text>
|
2005-01-26 21:32:52 +00:00
|
|
|
<xsl:value-of select="$dest.dir"/>
|
2004-05-31 21:15:52 +01:00
|
|
|
<xsl:text> &&

</xsl:text>
|
2006-02-14 20:18:58 +00:00
|
|
|
<!-- Remove old patches -->
|
|
|
|
<xsl:text>rm -f *.patch copyerrs && 

</xsl:text>
|
2004-05-31 21:15:52 +01:00
|
|
|
<xsl:apply-templates/>
|
2005-01-26 21:32:52 +00:00
|
|
|
<!-- Ensure correct owneship -->
|
2006-02-14 20:18:58 +00:00
|
|
|
<xsl:text>
chgrp lfswww *.patch &&
</xsl:text>
|
|
|
|
<xsl:text>
|
|
|
|
if [ `wc -l copyerrs | sed 's/ *//' | cut -f1 -d' '` -gt 0 ]; then
|
|
|
|
mail -s "Missing LFS patches" lfs-book@linuxfromscratch.org < copyerrs
|
|
|
|
fi

</xsl:text>
|
2006-12-20 10:07:39 +00:00
|
|
|
|
2006-02-14 20:18:58 +00:00
|
|
|
<xsl:text>exit
</xsl:text>
|
2004-05-31 21:15:52 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
2005-01-26 21:32:52 +00:00
|
|
|
<xsl:template match="//text()"/>
|
2004-05-08 15:19:53 +01:00
|
|
|
|
2004-05-19 21:16:58 +01:00
|
|
|
<xsl:template match="//ulink">
|
2005-01-26 21:32:52 +00:00
|
|
|
<!-- Match only local patches links and skip duplicated URLs splitted for PDF output-->
|
2006-12-20 10:07:39 +00:00
|
|
|
<xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')
|
2005-01-26 21:32:52 +00:00
|
|
|
and not(ancestor-or-self::*/@condition = 'pdf')">
|
|
|
|
<xsl:variable name="patch.name" select="substring-after(@url, '&patches-root;')"/>
|
2006-12-20 10:07:39 +00:00
|
|
|
<xsl:variable name="cut"
|
2005-01-26 21:32:52 +00:00
|
|
|
select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
|
|
|
|
<xsl:variable name="patch.name2">
|
|
|
|
<xsl:value-of select="substring-before($patch.name, '-')"/>
|
|
|
|
<xsl:text>-</xsl:text>
|
|
|
|
<xsl:value-of select="$cut"/>
|
|
|
|
</xsl:variable>
|
2006-12-20 10:07:39 +00:00
|
|
|
<xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads/</xsl:text>
|
2005-01-26 21:32:52 +00:00
|
|
|
<xsl:value-of select="substring-before($patch.name2, '-0')"/>
|
|
|
|
<xsl:text>/</xsl:text>
|
|
|
|
<xsl:value-of select="$patch.name"/>
|
|
|
|
<xsl:text> . 
</xsl:text>
|
2004-05-19 21:16:58 +01:00
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
2004-05-08 15:19:53 +01:00
|
|
|
|
|
|
|
</xsl:stylesheet>
|