2006-04-30 17:27:39 +02:00
|
|
|
<?xml version='1.0' encoding='ISO-8859-1'?>
|
|
|
|
|
2006-05-23 20:31:02 +02:00
|
|
|
<!-- $Id$ -->
|
|
|
|
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
version="1.0">
|
|
|
|
|
|
|
|
<xsl:output method="text"/>
|
|
|
|
|
|
|
|
<!-- The FTP server used as fallback -->
|
|
|
|
<xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
|
|
|
|
|
2007-02-13 20:21:34 +01:00
|
|
|
<!-- The book family (lfs or clfs). Needed to use the proper FTP path. -->
|
|
|
|
<xsl:param name="family">lfs</xsl:param>
|
|
|
|
|
2006-04-30 17:27:39 +02:00
|
|
|
<!-- The libc model used for HLFS -->
|
2016-05-28 12:00:30 +02:00
|
|
|
<xsl:param name="model" select="'glibc'"/>
|
2006-04-30 17:27:39 +02:00
|
|
|
|
2007-06-03 12:54:07 +02:00
|
|
|
<!-- The kernel series used for HLFS -->
|
2016-05-28 12:00:30 +02:00
|
|
|
<xsl:param name="kernel" select="'2.6'"/>
|
2007-06-03 12:54:07 +02:00
|
|
|
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- Do we use a package manager? -->
|
2016-05-28 12:00:30 +02:00
|
|
|
<xsl:param name="pkgmngt" select="'n'"/>
|
|
|
|
|
|
|
|
<!-- The system for LFS: sysv of systemd -->
|
|
|
|
<xsl:param name="revision" select="'sysv'"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:template match="/">
|
2016-05-28 12:00:30 +02:00
|
|
|
<xsl:apply-templates select="//varlistentry[@revision=$revision
|
|
|
|
or not(@revision)]//ulink"/>
|
2012-02-02 00:29:37 +01:00
|
|
|
<xsl:if test="$pkgmngt='y'">
|
|
|
|
<xsl:apply-templates
|
|
|
|
select="document('packageManager.xml')//ulink"/>
|
|
|
|
</xsl:if>
|
2006-04-30 17:27:39 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="ulink">
|
2012-02-02 00:29:37 +01:00
|
|
|
<!-- If some package doesn't have the predefined strings in their
|
2006-04-30 17:27:39 +02:00
|
|
|
name, the next test must be fixed to match it also. Skip possible
|
|
|
|
duplicated URLs due that may be splitted for PDF output -->
|
|
|
|
<xsl:if test="(ancestor::varlistentry[@condition=$model]
|
|
|
|
or not(ancestor::varlistentry[@condition])) and
|
2007-06-03 12:54:07 +02:00
|
|
|
(ancestor::varlistentry[@vendor=$kernel]
|
|
|
|
or not(ancestor::varlistentry[@vendor])) and
|
2006-12-10 11:43:20 +01:00
|
|
|
(contains(@url, '.bz2') or contains(@url, '.tar.gz') or
|
2011-10-27 09:11:12 +02:00
|
|
|
contains(@url, '.tgz') or contains(@url, '.patch') or
|
2013-09-14 12:48:45 +02:00
|
|
|
contains(@url, '.xz') or contains(@url, '.lzma')) and
|
2006-04-30 17:27:39 +02:00
|
|
|
not(ancestor-or-self::*/@condition = 'pdf')">
|
|
|
|
<!-- Extract the package name -->
|
|
|
|
<xsl:variable name="package">
|
|
|
|
<xsl:call-template name="package.name">
|
|
|
|
<xsl:with-param name="url" select="@url"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
<!-- Extract the directory for that package -->
|
|
|
|
<xsl:variable name="cut"
|
|
|
|
select="translate(substring-after($package, '-'),
|
|
|
|
'0123456789', '0000000000')"/>
|
|
|
|
<xsl:variable name="package2">
|
|
|
|
<xsl:value-of select="substring-before($package, '-')"/>
|
|
|
|
<xsl:text>-</xsl:text>
|
|
|
|
<xsl:value-of select="$cut"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
|
2006-12-04 18:47:37 +01:00
|
|
|
<!-- Write the upstream URLs, fixing the redirected ones -->
|
2006-05-06 22:03:02 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(@url,'?')">
|
2006-12-04 18:47:37 +01:00
|
|
|
<xsl:value-of select="substring-before(@url,'?')"/>
|
2006-05-06 22:03:02 +02:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="@url"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2006-04-30 21:42:10 +02:00
|
|
|
<xsl:text> </xsl:text>
|
2006-05-06 22:03:02 +02:00
|
|
|
<!-- Write FTP mirror URLs -->
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:value-of select="$server"/>
|
2007-02-13 20:21:34 +01:00
|
|
|
<xsl:text>/pub/</xsl:text>
|
|
|
|
<xsl:value-of select="$family"/>
|
|
|
|
<xsl:text>/conglomeration/</xsl:text>
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:choose>
|
2006-05-12 21:35:26 +02:00
|
|
|
<!-- Fix some directories. Test against $dirname to be sure that we
|
|
|
|
are matching the start of a package name, not a string in a patch name
|
|
|
|
But some packages requires test against $package. -->
|
2006-05-09 19:26:09 +02:00
|
|
|
<xsl:when test="contains($dirname, 'bash')">
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:text>bash/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-12 21:15:39 +02:00
|
|
|
<xsl:when test="contains($package, 'dvhtool')">
|
|
|
|
<xsl:text>dvhtool/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-09 19:26:09 +02:00
|
|
|
<xsl:when test="contains($dirname, 'gcc')">
|
2006-04-30 18:46:00 +02:00
|
|
|
<xsl:text>gcc/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-09 19:26:09 +02:00
|
|
|
<xsl:when test="contains($dirname, 'glibc')">
|
2006-04-30 17:49:43 +02:00
|
|
|
<xsl:text>glibc/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-12 21:35:26 +02:00
|
|
|
<xsl:when test="contains($package, 'powerpc-utils')">
|
|
|
|
<xsl:text>powerpc-utils/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-11 23:22:57 +02:00
|
|
|
<xsl:when test="contains($package, 'tcl')">
|
2006-04-30 17:49:43 +02:00
|
|
|
<xsl:text>tcl/</xsl:text>
|
|
|
|
</xsl:when>
|
2007-02-13 20:21:34 +01:00
|
|
|
<xsl:when test="contains($package, 'uClibc')">
|
2006-04-30 18:46:00 +02:00
|
|
|
<xsl:text>uClibc/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-05-09 19:26:09 +02:00
|
|
|
<xsl:when test="contains($dirname, 'udev')">
|
2006-04-30 18:09:18 +02:00
|
|
|
<xsl:text>udev/</xsl:text>
|
|
|
|
</xsl:when>
|
2017-04-01 13:05:15 +02:00
|
|
|
<xsl:when test="contains($dirname, 'iputils')">
|
|
|
|
<xsl:text>iputils/</xsl:text>
|
|
|
|
</xsl:when>
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$dirname"/>
|
|
|
|
<xsl:text>/</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:value-of select="$package"/>
|
2006-05-06 22:03:02 +02:00
|
|
|
<!-- Write MD5SUM value -->
|
|
|
|
<xsl:text> </xsl:text>
|
2014-12-21 12:25:47 +01:00
|
|
|
<xsl:value-of select="../following-sibling::para/literal"/>
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="package.name">
|
|
|
|
<xsl:param name="url"/>
|
|
|
|
<xsl:choose>
|
2014-05-07 17:30:33 +02:00
|
|
|
<xsl:when test="contains($url, '/') and not (substring-after($url,'/')='')">
|
2006-04-30 17:27:39 +02:00
|
|
|
<xsl:call-template name="package.name">
|
|
|
|
<xsl:with-param name="url" select="substring-after($url, '/')"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($url, '?')">
|
|
|
|
<xsl:value-of select="substring-before($url, '?')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$url"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|