source: common/packages.xsl@ 610a5c4

ablfs-more legacy trunk
Last change on this file since 610a5c4 was fd4a798, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove $Id$ comments, they are useless with git

  • Property mode set to 100644
File size: 2.3 KB
Line 
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 libc model used for HLFS -->
9 <xsl:param name="model" select="'glibc'"/>
10
11 <!-- The kernel series used for HLFS -->
12 <xsl:param name="kernel" select="'2.6'"/>
13
14 <!-- Should we include a package manager? -->
15 <xsl:param name="pkgmngt" select="'n'"/>
16
17 <!-- The system for LFS: sysv of systemd -->
18 <xsl:param name="revision" select="'sysv'"/>
19
20 <xsl:template match="/">
21 <xsl:apply-templates
22 select="//varlistentry[(@condition=$model or not(@condition)) and
23 (@revision=$revision or not(@revision)) and
24 (@vendor=$kernel or not(@vendor))]
25 //para[contains(string(),'Download:')]"/>
26 <xsl:if test="$pkgmngt='y'">
27 <xsl:apply-templates
28 select="document('packageManager.xml')//sect1[@id='package']//para"/>
29 </xsl:if>
30 </xsl:template>
31
32 <xsl:template match="para">
33 <xsl:call-template name="package_name">
34 <xsl:with-param name="url" select="ulink/@url"/>
35 </xsl:call-template>
36 </xsl:template>
37
38 <xsl:template name="package_name">
39 <xsl:param name="url" select="'foo'"/>
40 <xsl:variable name="sub-url" select="substring-after($url,'/')"/>
41 <xsl:choose>
42 <xsl:when test="contains($sub-url,'/') and
43 not(substring-after($sub-url,'/')='')">
44 <xsl:call-template name="package_name">
45 <xsl:with-param name="url" select="$sub-url"/>
46 </xsl:call-template>
47 </xsl:when>
48 <xsl:otherwise>
49 <xsl:choose>
50 <xsl:when test="contains($sub-url,'.patch')"/>
51 <xsl:when test="contains($sub-url,'?')">
52 <xsl:value-of select="substring-before($sub-url,'?')"/>
53 <xsl:text>&#xA;</xsl:text>
54 </xsl:when>
55 <xsl:when test="contains($sub-url,'/')">
56 <xsl:value-of select="substring-before($sub-url,'/')"/>
57 <xsl:text>&#xA;</xsl:text>
58 </xsl:when>
59 <xsl:otherwise>
60 <xsl:value-of select="$sub-url"/>
61 <xsl:text>&#xA;</xsl:text>
62 </xsl:otherwise>
63 </xsl:choose>
64 </xsl:otherwise>
65 </xsl:choose>
66 </xsl:template>
67
68</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.