source: common/packages.xsl@ 5ed79ef

ablfs
Last change on this file since 5ed79ef was 7072e1f, checked in by Thomas Pegg <thomasp@…>, 13 years ago

Commit Pierre Labastie's patch for including package management support in jhalfs. NOTE: Package management is by default disabled.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[a160d86]1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!-- $Id$ -->
4
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
7
8 <xsl:output method="text"/>
9
[139c34e]10 <!-- The libc model used for HLFS -->
11 <xsl:param name="model" select="glibc"/>
12
13 <!-- The kernel series used for HLFS -->
14 <xsl:param name="kernel" select="2.6"/>
15
[7072e1f]16 <!-- Should we include a package manager -->
17 <xsl:param name="pkgmngt" select="n"/>
18
[a160d86]19 <xsl:template match="/">
20 <xsl:apply-templates select="//para"/>
[7072e1f]21 <xsl:if test="$pkgmngt='y'">
22 <xsl:apply-templates
23 select="document('packageManager.xml')//sect1[@id='package']//para"/>
24 </xsl:if>
[a160d86]25 </xsl:template>
26
27 <xsl:template match="para">
[139c34e]28 <xsl:if test="contains(string(),'Download:') and
29 (ancestor::varlistentry[@condition=$model]
30 or not(ancestor::varlistentry[@condition])) and
31 (ancestor::varlistentry[@vendor=$kernel]
32 or not(ancestor::varlistentry[@vendor]))">
[a160d86]33 <xsl:call-template name="package_name">
34 <xsl:with-param name="url" select="ulink/@url"/>
35 </xsl:call-template>
36 </xsl:if>
37 </xsl:template>
38
39 <xsl:template name="package_name">
40 <xsl:param name="url" select="foo"/>
[7072e1f]41 <xsl:variable name="sub-url" select="substring-after($url,'/')"/>
[a160d86]42 <xsl:choose>
43 <xsl:when test="contains($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,'?')"/>
[7072e1f]53 <xsl:text>&#xA;</xsl:text>
[a160d86]54 </xsl:when>
55 <xsl:otherwise>
56 <xsl:value-of select="$sub-url"/>
[7072e1f]57 <xsl:text>&#xA;</xsl:text>
[a160d86]58 </xsl:otherwise>
59 </xsl:choose>
60 </xsl:otherwise>
61 </xsl:choose>
62 </xsl:template>
63
64</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.