source: common/packages.xsl@ b8e5cad

ablfs-more legacy trunk
Last change on this file since b8e5cad 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
RevLine 
[a160d86]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
[139c34e]8 <!-- The libc model used for HLFS -->
[c9598f2]9 <xsl:param name="model" select="'glibc'"/>
[139c34e]10
11 <!-- The kernel series used for HLFS -->
[c9598f2]12 <xsl:param name="kernel" select="'2.6'"/>
[139c34e]13
[c9598f2]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'"/>
[7072e1f]19
[a160d86]20 <xsl:template match="/">
[7b33f40]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:')]"/>
[7072e1f]26 <xsl:if test="$pkgmngt='y'">
27 <xsl:apply-templates
28 select="document('packageManager.xml')//sect1[@id='package']//para"/>
29 </xsl:if>
[a160d86]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">
[7b33f40]39 <xsl:param name="url" select="'foo'"/>
[7072e1f]40 <xsl:variable name="sub-url" select="substring-after($url,'/')"/>
[a160d86]41 <xsl:choose>
[ff9938f]42 <xsl:when test="contains($sub-url,'/') and
43 not(substring-after($sub-url,'/')='')">
[a160d86]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,'?')"/>
[7072e1f]53 <xsl:text>&#xA;</xsl:text>
[a160d86]54 </xsl:when>
[ff9938f]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>
[a160d86]59 <xsl:otherwise>
60 <xsl:value-of select="$sub-url"/>
[7072e1f]61 <xsl:text>&#xA;</xsl:text>
[a160d86]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.