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>
</xsl:text>
|
---|
54 | </xsl:when>
|
---|
55 | <xsl:when test="contains($sub-url,'/')">
|
---|
56 | <xsl:value-of select="substring-before($sub-url,'/')"/>
|
---|
57 | <xsl:text>
</xsl:text>
|
---|
58 | </xsl:when>
|
---|
59 | <xsl:otherwise>
|
---|
60 | <xsl:value-of select="$sub-url"/>
|
---|
61 | <xsl:text>
</xsl:text>
|
---|
62 | </xsl:otherwise>
|
---|
63 | </xsl:choose>
|
---|
64 | </xsl:otherwise>
|
---|
65 | </xsl:choose>
|
---|
66 | </xsl:template>
|
---|
67 |
|
---|
68 | </xsl:stylesheet>
|
---|