source: stylesheets/wget-list.xsl@ 3a4594b

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 3a4594b was 3a4594b, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Added a stylesheet and Makefile target that will allow the dynamic creation of a wget-list.
Stylesheet is modified from jhalfs-2.0.
This will be useful to our current FTP maintainer in dynamically collecting packages.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7878 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.5 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!-- $Id$ -->
4
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
7
8 <xsl:output method="text"/>
9
10 <!-- The FTP server used as fallback -->
11 <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
12
13 <!-- The libc model used for HLFS -->
14 <xsl:param name="model" select="glibc"/>
15
16 <xsl:template match="/">
17 <xsl:apply-templates select="//ulink"/>
18 </xsl:template>
19
20 <xsl:template match="ulink">
21 <!-- If some package don't have the predefined strings in their
22 name, the next test must be fixed to match it also. Skip possible
23 duplicated URLs due that may be splitted for PDF output -->
24 <xsl:if test="(ancestor::varlistentry[@condition=$model]
25 or not(ancestor::varlistentry[@condition])) and
26 (contains(@url, '.tar.') or contains(@url, '.tgz')
27 or contains(@url, '.patch')) and
28 not(ancestor-or-self::*/@condition = 'pdf')">
29 <!-- Extract the package name -->
30 <xsl:variable name="package">
31 <xsl:call-template name="package.name">
32 <xsl:with-param name="url" select="@url"/>
33 </xsl:call-template>
34 </xsl:variable>
35 <!-- Extract the directory for that package -->
36 <xsl:variable name="cut"
37 select="translate(substring-after($package, '-'),
38 '0123456789', '0000000000')"/>
39 <xsl:variable name="package2">
40 <xsl:value-of select="substring-before($package, '-')"/>
41 <xsl:text>-</xsl:text>
42 <xsl:value-of select="$cut"/>
43 </xsl:variable>
44 <xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
45 <!-- Write the upstream URLs, except the redirected ones -->
46 <xsl:value-of select="@url"/>
47 <xsl:text> </xsl:text>
48 <xsl:text>&#x0a;</xsl:text>
49 </xsl:if>
50 </xsl:template>
51
52 <xsl:template name="package.name">
53 <xsl:param name="url"/>
54 <xsl:choose>
55 <xsl:when test="contains($url, '/')">
56 <xsl:call-template name="package.name">
57 <xsl:with-param name="url" select="substring-after($url, '/')"/>
58 </xsl:call-template>
59 </xsl:when>
60 <xsl:otherwise>
61 <xsl:choose>
62 <xsl:when test="contains($url, '?')">
63 <xsl:value-of select="substring-before($url, '?')"/>
64 </xsl:when>
65 <xsl:otherwise>
66 <xsl:value-of select="$url"/>
67 </xsl:otherwise>
68 </xsl:choose>
69 </xsl:otherwise>
70 </xsl:choose>
71 </xsl:template>
72
73</xsl:stylesheet>
74
Note: See TracBrowser for help on using the repository browser.