source: common/urls.xsl@ 875366f

ablfs-more trunk
Last change on this file since 875366f was 88e5cbc, checked in by Pierre Labastie <pierre.labastie@…>, 2 years ago

Use only upstream's URL in urls.lst

  • Property mode set to 100644
File size: 2.7 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
[7072e1f]11 <!-- Do we use a package manager? -->
[c9598f2]12 <xsl:param name="pkgmngt" select="'n'"/>
13
14 <!-- The system for LFS: sysv of systemd -->
15 <xsl:param name="revision" select="'sysv'"/>
[7072e1f]16
[ebf8265]17 <xsl:template match="/">
[c9598f2]18 <xsl:apply-templates select="//varlistentry[@revision=$revision
19 or not(@revision)]//ulink"/>
[7072e1f]20 <xsl:if test="$pkgmngt='y'">
21 <xsl:apply-templates
22 select="document('packageManager.xml')//ulink"/>
23 </xsl:if>
[ebf8265]24 </xsl:template>
25
26 <xsl:template match="ulink">
[7072e1f]27 <!-- If some package doesn't have the predefined strings in their
[ebf8265]28 name, the next test must be fixed to match it also. Skip possible
29 duplicated URLs due that may be splitted for PDF output -->
[978286a]30 <xsl:if test="(contains(@url, '.bz2') or contains(@url, '.tar.gz') or
[a7e1348]31 contains(@url, '.tgz') or contains(@url, '.patch') or
[038678f]32 contains(@url, '.xz') or contains(@url, '.lzma')) and
[ebf8265]33 not(ancestor-or-self::*/@condition = 'pdf')">
34 <!-- Extract the package name -->
35 <xsl:variable name="package">
36 <xsl:call-template name="package.name">
37 <xsl:with-param name="url" select="@url"/>
38 </xsl:call-template>
39 </xsl:variable>
[f221c2c]40 <!-- Write the upstream URLs, fixing the redirected ones -->
[26053c4]41 <xsl:choose>
42 <xsl:when test="contains(@url,'?')">
[f221c2c]43 <xsl:value-of select="substring-before(@url,'?')"/>
[26053c4]44 </xsl:when>
45 <xsl:otherwise>
46 <xsl:value-of select="@url"/>
47 </xsl:otherwise>
48 </xsl:choose>
49 <!-- Write MD5SUM value -->
50 <xsl:text> </xsl:text>
[56d8426]51 <xsl:value-of select="../following-sibling::para/literal"/>
[ebf8265]52 <xsl:text>&#x0a;</xsl:text>
53 </xsl:if>
54 </xsl:template>
55
56 <xsl:template name="package.name">
57 <xsl:param name="url"/>
58 <xsl:choose>
[719d0fc]59 <xsl:when test="contains($url, '/') and not (substring-after($url,'/')='')">
[ebf8265]60 <xsl:call-template name="package.name">
61 <xsl:with-param name="url" select="substring-after($url, '/')"/>
62 </xsl:call-template>
63 </xsl:when>
64 <xsl:otherwise>
65 <xsl:choose>
66 <xsl:when test="contains($url, '?')">
67 <xsl:value-of select="substring-before($url, '?')"/>
68 </xsl:when>
69 <xsl:otherwise>
70 <xsl:value-of select="$url"/>
71 </xsl:otherwise>
72 </xsl:choose>
73 </xsl:otherwise>
74 </xsl:choose>
75 </xsl:template>
76
77</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.