Changeset 506120ee for BLFS/xsl/gen_pkg_list.xsl
- Timestamp:
- 08/09/2017 01:55:55 PM (7 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- dd08e14
- Parents:
- 200fbde
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/gen_pkg_list.xsl
r200fbde r506120ee 6 6 installed packages in the tracking file (stringparam 7 7 'installed-packages') --> 8 <!-- Extract also a list of LFS packages from stringparam lfs-full --> 8 9 9 10 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 10 11 version="1.0"> 11 12 13 <xsl:param name="lfs-full" select="'./lfs-xml/lfs-full.xml'"/> 12 14 <xsl:param name="installed-packages" select="'../lib/instpkg.xml'"/> 13 15 … … 23 25 <xsl:template match="/"> 24 26 <princList> 25 <xsl:text>

</xsl:text> 27 <xsl:text>

 </xsl:text> 28 <list> 29 <xsl:attribute name="id">lfs</xsl:attribute> 30 <xsl:text>
 </xsl:text> 31 <name>LFS Packages</name> 32 <xsl:text>
 </xsl:text> 33 <sublist> 34 <xsl:attribute name="id">lfs-6</xsl:attribute> 35 <xsl:text>
 </xsl:text> 36 <name>LFS Chapter 6</name> 37 <xsl:apply-templates 38 select='document($lfs-full)// 39 chapter[@id="chapter-building-system"]/ 40 sect1/sect1info'/> 41 <xsl:text>
 </xsl:text> 42 </sublist> 43 <sublist> 44 <xsl:attribute name="id">lfs-8</xsl:attribute> 45 <xsl:text>
 </xsl:text> 46 <name>LFS Chapter 8</name> 47 <xsl:apply-templates select='document($lfs-full)//chapter[@id="chapter-bootable"]/sect1/sect1info[./productname="linux"]'/> 48 <xsl:text>
 </xsl:text> 49 </sublist> 50 <sublist> 51 <xsl:attribute name="id">lfs-9</xsl:attribute> 52 <xsl:text>
 </xsl:text> 53 <name>LFS Chapter 9</name> 54 <xsl:apply-templates select='document($lfs-full)//sect1[@id="ch-finish-theend"]//userinput[starts-with(string(),"echo")]'/> 55 <xsl:text>
 </xsl:text> 56 </sublist> 57 <xsl:text>

 </xsl:text> 58 </list> 26 59 <!-- How to have blfs-bootscripts versionned? Do not know, so 27 60 avoid it (TODO ?) --> 28 61 <xsl:apply-templates select="//part[not(@id='introduction')]"/> 29 62 </princList> 63 </xsl:template> 64 65 <xsl:template match="userinput"> 66 <!-- Only used in lFS chapter 9, to retrieve book version --> 67 <package> 68 <name>LFS-Release</name> 69 <xsl:element name="version"> 70 <xsl:copy-of select="substring-after(substring-before(string(),' >'),'echo ')"/> 71 </xsl:element> 72 <xsl:if 73 test="document($installed-packages)//package[name='LFS-Release']"> 74 <xsl:text>
 </xsl:text> 75 <xsl:element name="inst-version"> 76 <xsl:value-of 77 select="document( 78 $installed-packages 79 )//package[name='LFS-Release']/version"/> 80 </xsl:element> 81 </xsl:if> 82 </package> 83 </xsl:template> 84 85 <xsl:template match="sect1info"> 86 <xsl:text> </xsl:text> 87 <xsl:choose> 88 <!-- Never update linux headers --> 89 <xsl:when test="./productname='linux' 90 and ancestor::chapter[@id='chapter-building-system']"/> 91 <!-- Gcc version is taken from BLFS --> 92 <xsl:when test="./productname='gcc'"/> 93 <!-- Shadow version is taken from BLFS --> 94 <xsl:when test="./productname='shadow'"/> 95 <!-- Dbus version is taken from BLFS --> 96 <xsl:when test="./productname='dbus'"/> 97 <!-- Systemd version is taken from BLFS --> 98 <xsl:when test="./productname='systemd'"/> 99 <xsl:otherwise> 100 <package><xsl:text>
 </xsl:text> 101 <xsl:element name="name"> 102 <xsl:value-of select="./productname"/> 103 </xsl:element> 104 <xsl:text>
 </xsl:text> 105 <xsl:element name="version"> 106 <xsl:value-of select="./productnumber"/> 107 </xsl:element> 108 <xsl:if 109 test="document($installed-packages)//package[name=current()/productname]"> 110 <xsl:text>
 </xsl:text> 111 <xsl:element name="inst-version"> 112 <xsl:value-of 113 select="document( 114 $installed-packages 115 )//package[name=current()/productname]/version"/> 116 </xsl:element> 117 </xsl:if> 118 </package> 119 </xsl:otherwise> 120 </xsl:choose> 121 <!-- No deps for now: a former version is always installed --> 30 122 </xsl:template> 31 123
Note:
See TracChangeset
for help on using the changeset viewer.