source: common/urls.xsl@ 046d5c3

1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 046d5c3 was 046d5c3, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Fixed powerpc-utils download URL.

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[ebf8265]1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 version="1.0">
5
6 <xsl:output method="text"/>
7
8 <!-- The FTP server used as fallback -->
9 <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
10
11 <!-- The libc model used for HLFS -->
12 <xsl:param name="model" select="glibc"/>
13
14 <xsl:template match="/">
15 <xsl:apply-templates select="//ulink"/>
16 </xsl:template>
17
18 <xsl:template match="ulink">
19 <!-- If some package don't have the predefined strings in their
20 name, the next test must be fixed to match it also. Skip possible
21 duplicated URLs due that may be splitted for PDF output -->
22 <xsl:if test="(ancestor::varlistentry[@condition=$model]
23 or not(ancestor::varlistentry[@condition])) and
24 (contains(@url, '.tar.') or contains(@url, '.tgz')
[aa901e7]25 or contains(@url, '.patch')) and
[ebf8265]26 not(ancestor-or-self::*/@condition = 'pdf')">
27 <!-- Extract the package name -->
28 <xsl:variable name="package">
29 <xsl:call-template name="package.name">
30 <xsl:with-param name="url" select="@url"/>
31 </xsl:call-template>
32 </xsl:variable>
33 <!-- Extract the directory for that package -->
34 <xsl:variable name="cut"
35 select="translate(substring-after($package, '-'),
36 '0123456789', '0000000000')"/>
37 <xsl:variable name="package2">
38 <xsl:value-of select="substring-before($package, '-')"/>
39 <xsl:text>-</xsl:text>
40 <xsl:value-of select="$cut"/>
41 </xsl:variable>
42 <xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
43 <!-- Write the upstream URLs, except the redirected ones -->
[26053c4]44 <xsl:choose>
45 <xsl:when test="contains(@url,'?')">
46 <xsl:text>dummy-url</xsl:text>
47 </xsl:when>
48 <xsl:otherwise>
49 <xsl:value-of select="@url"/>
50 </xsl:otherwise>
51 </xsl:choose>
[15cad16]52 <xsl:text> </xsl:text>
[26053c4]53 <!-- Write FTP mirror URLs -->
[ebf8265]54 <xsl:value-of select="$server"/>
55 <xsl:text>/pub/lfs/conglomeration/</xsl:text>
56 <xsl:choose>
[046d5c3]57 <!-- Fix some directories. Test against $dirname to be sure that we
58 are matching the start of a package name, not a string in a patch name
59 But some packages requires test against $package. -->
[e071571]60 <xsl:when test="contains($dirname, 'bash')">
[ebf8265]61 <xsl:text>bash/</xsl:text>
62 </xsl:when>
[9be4494]63 <xsl:when test="contains($package, 'dvhtool')">
64 <xsl:text>dvhtool/</xsl:text>
65 </xsl:when>
[e071571]66 <xsl:when test="contains($dirname, 'gcc')">
[c03b616]67 <xsl:text>gcc/</xsl:text>
68 </xsl:when>
[e071571]69 <xsl:when test="contains($dirname, 'glibc')">
[7453f74]70 <xsl:text>glibc/</xsl:text>
71 </xsl:when>
[046d5c3]72 <xsl:when test="contains($package, 'powerpc-utils')">
73 <xsl:text>powerpc-utils/</xsl:text>
74 </xsl:when>
[4887f67]75 <xsl:when test="contains($package, 'tcl')">
[7453f74]76 <xsl:text>tcl/</xsl:text>
77 </xsl:when>
[e071571]78 <xsl:when test="contains($dirname, 'uClibc')">
[c03b616]79 <xsl:text>uClibc/</xsl:text>
80 </xsl:when>
[e071571]81 <xsl:when test="contains($dirname, 'udev')">
[ee5e8f0]82 <xsl:text>udev/</xsl:text>
83 </xsl:when>
[ebf8265]84 <xsl:otherwise>
85 <xsl:value-of select="$dirname"/>
86 <xsl:text>/</xsl:text>
87 </xsl:otherwise>
88 </xsl:choose>
89 <xsl:value-of select="$package"/>
[26053c4]90 <!-- Write MD5SUM value -->
91 <xsl:text> </xsl:text>
[a3a1394]92 <xsl:value-of select="../..//para/literal"/>
[ebf8265]93 <xsl:text>&#x0a;</xsl:text>
94 </xsl:if>
95 </xsl:template>
96
97 <xsl:template name="package.name">
98 <xsl:param name="url"/>
99 <xsl:choose>
100 <xsl:when test="contains($url, '/')">
101 <xsl:call-template name="package.name">
102 <xsl:with-param name="url" select="substring-after($url, '/')"/>
103 </xsl:call-template>
104 </xsl:when>
105 <xsl:otherwise>
106 <xsl:choose>
107 <xsl:when test="contains($url, '?')">
108 <xsl:value-of select="substring-before($url, '?')"/>
109 </xsl:when>
110 <xsl:otherwise>
111 <xsl:value-of select="$url"/>
112 </xsl:otherwise>
113 </xsl:choose>
114 </xsl:otherwise>
115 </xsl:choose>
116 </xsl:template>
117
118</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.