source: common/hostreqs.xsl@ 0974c32

ablfs-more legacy trunk
Last change on this file since 0974c32 was 2e1c1c3, checked in by Pierre Labastie <pierre@…>, 7 years ago

Remove spaces at the end of lines

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[1cf621b]1<?xml version="1.0" encoding="ISO-8859-1"?>
2
[316f845]3<!-- $Id$ -->
[1cf621b]4<!-- Extracts minimal versions from LFS book host requirements,
5 and generates a script containing statements of the
6 form MIN_prog_VERSION=xx.yy.zz.
7-->
8
9<xsl:stylesheet
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 version="1.0">
12
13 <xsl:output method="text"/>
14
15 <xsl:template match="/sect1">
16 <xsl:apply-templates select=".//listitem//emphasis"/>
17 </xsl:template>
18
19 <xsl:template match="emphasis">
[b86876a]20<!-- We assume that what is emphasized is in the form:
21aa...aa-dccsaaa (a anything except @, - "dash", d digit,
[2e1c1c3]22 c anything except space, s space)
[b86876a]23or
24aa...aasdccsaaa
25This means we have to replace digits with @, and look for '-@'
26or ' @' -->
27 <xsl:variable name="normalized-string"
28 select="translate(normalize-space(string()),
29 '0123456789',
30 '@@@@@@@@@@')"/>
31 <xsl:variable name="begin-ver">
32 <xsl:choose>
33 <xsl:when test="contains($normalized-string,' @')">
34 <xsl:value-of select="string-length(substring-before($normalized-string,' @'))+1"/>
35 </xsl:when>
36 <xsl:otherwise>
37 <xsl:value-of select="string-length(substring-before($normalized-string,'-@'))+1"/>
38 </xsl:otherwise>
39 </xsl:choose>
40 </xsl:variable>
41
42 <xsl:variable name="remaining-part"
43 select="substring($normalized-string,number($begin-ver)+1)"/>
44
45 <xsl:variable name="end-ver">
46 <xsl:choose>
47 <xsl:when test="contains($remaining-part,' ')">
48 <xsl:value-of
49 select="string-length(substring-before($remaining-part,' '))"/>
50 </xsl:when>
51 <xsl:otherwise>
52 <xsl:value-of
53 select="string-length($remaining-part)"/>
54 </xsl:otherwise>
55 </xsl:choose>
56 </xsl:variable>
57
[1cf621b]58 <xsl:text>local MIN_</xsl:text>
59 <xsl:choose>
[b86876a]60 <xsl:when test="contains(string(),'Kernel')">
61 <xsl:text>Linux</xsl:text>
62 </xsl:when>
63 <xsl:when test="contains(string(),'GLIBC')">
64 <xsl:text>Glibc</xsl:text>
65 </xsl:when>
66 <xsl:when test="contains(string(),'XZ')">
67 <xsl:text>Xz</xsl:text>
[1cf621b]68 </xsl:when>
69 <xsl:otherwise>
[b86876a]70<!-- We assume that there are no dash nor space in other names -->
71 <xsl:value-of select="substring(string(),1,number($begin-ver)-1)"/>
[1cf621b]72 </xsl:otherwise>
73 </xsl:choose>
74 <xsl:text>_VER=</xsl:text>
[b86876a]75 <xsl:value-of select="substring(string(),number($begin-ver)+1,$end-ver)"/>
[1cf621b]76 <xsl:text>
77</xsl:text>
78 </xsl:template>
79</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.