- Timestamp:
- 03/16/2006 09:26:27 PM (19 years ago)
- Branches:
- experimental
- Children:
- 5365c39
- Parents:
- 57ca090
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
HLFS/hlfs.xsl
r57ca090 r174a8e9 5 5 ]> 6 6 7 <!-- $Id$ --> 8 7 9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 8 10 xmlns:exsl="http://exslt.org/common" … … 10 12 version="1.0"> 11 13 12 <!-- XSLT stylesheet to create shell scripts from LFS books. --> 13 14 <!-- Run optional test suites? --> 15 <xsl:param name="testsuite" select="0"/> 16 17 <!-- Run toolchain test suites? --> 18 <xsl:param name="toolchaintest" select="1"/> 14 <!-- XSLT stylesheet to create shell scripts from HLFS books. --> 15 16 <!-- What libc implentation must be used? --> 17 <xsl:param name="model" select="glibc"/> 18 19 <!-- Run test suites? 20 0 = none 21 1 = only chapter06 Glibc, GCC and Binutils testsuites 22 2 = all chapter06 testsuites 23 3 = all chapter05 and chapter06 testsuites--> 24 <xsl:param name="testsuite" select="1"/> 19 25 20 26 <!-- Install vim-lang package? --> … … 26 32 27 33 <xsl:template match="sect1"> 28 <xsl:if test="count(descendant::screen/userinput) > 0 and 29 count(descendant::screen/userinput) > count(descendant::screen[@role='nodump'])"> 34 <xsl:if test="(../@id='chapter-temporary-tools' or 35 ../@id='chapter-building-system' or 36 ../@id='chapter-bootable') and 37 ((@condition=$model or not(@condition)) and 38 count(descendant::screen/userinput) > 0 and 39 count(descendant::screen/userinput) > 40 count(descendant::screen[@role='nodump']))"> 30 41 <!-- The dirs names --> 31 42 <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/> … … 54 65 </xsl:choose> 55 66 </xsl:variable> 56 57 67 <!-- Creating dirs and files --> 58 68 <exsl:document href="{$dirname}/{$order}-{$filename}" method="text"> 59 <!-- Add a header to each script -->60 69 <xsl:choose> 61 70 <xsl:when test="@id='ch-system-changingowner' or 62 63 71 @id='ch-system-creatingdirs' or 72 @id='ch-system-createfiles'"> 64 73 <xsl:text>#!/tools/bin/bash
set -e

</xsl:text> 65 74 </xsl:when> 66 67 75 <xsl:when test="@id='ch-tools-stripping' or 68 76 @id='ch-system-strippingagain'"> 69 77 <xsl:text>#!/bin/sh
</xsl:text> 70 78 </xsl:when> 71 72 79 <xsl:otherwise> 73 80 <xsl:text>#!/bin/sh
set -e

</xsl:text> 74 81 </xsl:otherwise> 75 82 </xsl:choose> 76 77 83 <xsl:if test="sect2[@role='installation'] or 78 84 @id='ch-tools-adjusting' or … … 82 88 <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1
</xsl:text> 83 89 </xsl:if> 84 <xsl:if test="@id='ch-tools-uclibc' ">90 <xsl:if test="@id='ch-tools-uclibc' or @id='ch-system-uclibc'"> 85 91 <xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; 
</xsl:text> 86 92 </xsl:if> 87 <xsl:if test="@id='ch-system-uclibc'"> 88 <xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; 
</xsl:text> 89 </xsl:if> 90 <xsl:if test="@id='ch-system-glibc'"> 93 <xsl:if test="@id='ch-tools-glibc' or @id='ch-system-glibc'"> 91 94 <xsl:text>tar -xvf ../glibc-libidn-&glibc-version;.*
</xsl:text> 92 95 </xsl:if> 93 <xsl:if test="@id='ch-tools-glibc'"> 94 <xsl:text>tar -xvf ../glibc-libidn-&glibc-version;.*
</xsl:text> 95 </xsl:if> 96 <xsl:if test="@id='ch-system-gcc'"> 96 <xsl:if test="@id='ch-tools-gcc' or @id='ch-system-gcc'"> 97 97 <xsl:text>pushd ../; tar -xvf gcc-g++-&gcc-version;.*; popd; 
</xsl:text> 98 98 </xsl:if> 99 <xsl:if test="@id='ch-tools-gcc'"> 100 <xsl:text>pushd ../; tar -xvf gcc-g++-&gcc-version;.*; popd; 
</xsl:text> 99 <xsl:if test="@id='ch-tools-gcc' and $testsuite = '3'"> 100 <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; 
</xsl:text> 101 </xsl:if> 102 <xsl:if test="@id='ch-system-gcc' and $testsuite != '0'"> 103 <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; 
</xsl:text> 101 104 </xsl:if> 102 105 <xsl:if test="@id='bootable-bootscripts'"> … … 111 114 112 115 <xsl:template match="screen"> 113 <xsl:if test="child::* = userinput"> 114 <xsl:choose> 115 <xsl:when test="@role = 'nodump'"/> 116 <xsl:when test="@condition != $model"/> 117 <xsl:otherwise> 118 <xsl:apply-templates select="userinput" mode="screen"/> 119 </xsl:otherwise> 120 </xsl:choose> 116 <xsl:if test="(@condition=$model or not(@condition)) and 117 child::* = userinput and not(@role = 'nodump')"> 118 <xsl:apply-templates select="userinput" mode="screen"/> 121 119 </xsl:if> 122 120 </xsl:template> 123 121 124 122 <xsl:template match="para/userinput"> 125 <xsl:if test="$testsuite != '0' and 126 (contains(string(),'test') or contains(string(),'check'))"> 123 <xsl:if test="(contains(string(),'test') or 124 contains(string(),'check')) and 125 (($testsuite = '1' and 126 (ancestor::sect1[@id='ch-system-gcc'] or 127 ancestor::sect1[@id='ch-system-glibc'])) or 128 ($testsuite = '2' and 129 ancestor::chapter[@id='chapter-building-system']) or 130 $testsuite = '3')"> 127 131 <xsl:value-of select="substring-before(string(),'make')"/> 128 132 <xsl:text>make -k</xsl:text> … … 148 152 <xsl:text>
</xsl:text> 149 153 </xsl:when> 150 154 <!-- Setting $LC_ALL and $LANG for /etc/profile --> 155 <xsl:when test="ancestor::sect1[@id='bootable-profile'] and 156 contains(string(),'export LANG=')"> 157 <xsl:value-of select="substring-before(string(),'export LC_ALL=')"/> 158 <xsl:text>export LC_ALL=$LC_ALL
export LANG=$LANG
</xsl:text> 159 <xsl:text>export INPUTRC</xsl:text> 160 <xsl:value-of select="substring-after(string(),'INPUTRC')"/> 161 <xsl:text>
</xsl:text> 162 </xsl:when> 151 163 <!-- Copying the kernel config file --> 152 164 <xsl:when test="string() = 'make mrproper'"> … … 154 166 <xsl:text>cp -v /sources/kernel-config .config
</xsl:text> 155 167 </xsl:when> 156 157 168 <!-- The Coreutils and Module-Init-Tools test suites are optional --> 158 <xsl:when test=" $testsuite = '0'and169 <xsl:when test="($testsuite = '0' or $testsuite = '1') and 159 170 (ancestor::sect1[@id='ch-system-coreutils'] or 160 171 ancestor::sect1[@id='ch-system-module-init-tools']) and 161 172 (contains(string(),'check') or 162 contains(string(),'dummy'))"/>163 173 contains(string(),'distclean') or 174 contains(string(),'dummy'))"/> 164 175 <!-- Fixing toolchain test suites run --> 165 176 <xsl:when test="string() = 'make check' or 166 string() = 'make -k check'"> 167 <xsl:choose> 168 <xsl:when test="$toolchaintest = '0'"/> 169 <xsl:otherwise> 177 string() = 'make -k check'"> 178 <xsl:choose> 179 <xsl:when test="(($testsuite = '1' or $testsuite = '2') and 180 ancestor::chapter[@id='chapter-building-system']) or 181 $testsuite = '3'"> 170 182 <xsl:text>make -k check || true</xsl:text> 171 183 <xsl:text>
</xsl:text> 172 </xsl:otherwise> 173 </xsl:choose> 174 </xsl:when> 175 <xsl:when test="contains(string(),'glibc-check-log')"> 176 <xsl:choose> 177 <xsl:when test="$toolchaintest = '0'"/> 178 <xsl:otherwise> 179 <xsl:value-of select="substring-before(string(),'
')"/> 180 <xsl:text> || true
</xsl:text> 181 <xsl:value-of select="substring-after(string(),'
')"/> 182 <xsl:text>
</xsl:text> 183 </xsl:otherwise> 184 </xsl:choose> 185 </xsl:when> 186 <xsl:when test="contains(string(),'test_summary') or 187 contains(string(),'expect -c')"> 188 <xsl:choose> 189 <xsl:when test="$toolchaintest = '0'"/> 190 <xsl:otherwise> 191 <xsl:apply-templates/> 192 <xsl:text>
</xsl:text> 193 </xsl:otherwise> 184 </xsl:when> 185 </xsl:choose> 186 </xsl:when> 187 <xsl:when test="contains(string(),'make check') and 188 ancestor::sect1[@id='ch-system-binutils']"> 189 <xsl:choose> 190 <xsl:when test="$testsuite != '0'"> 191 <xsl:value-of select="substring-before(string(),'make check')"/> 192 <xsl:text>make -k check || true
</xsl:text> 193 </xsl:when> 194 194 </xsl:choose> 195 195 </xsl:when> … … 207 207 </xsl:template> 208 208 209 <!-- Deal with definable values defined inside <replaceable> -->210 209 <xsl:template match="replaceable"> 211 210 <xsl:choose> 212 <xsl:when test="ancestor::sect1[@id='ch-system-glibc']"> 213 <xsl:text>$TIMEZONE</xsl:text> 214 </xsl:when> 215 <xsl:when test="ancestor::sect1[@id='ch-system-uclibc']"> 211 <xsl:when test="ancestor::sect1[@id='ch-system-glibc'] or 212 ancestor::sect1[@id='ch-system-uclibc']"> 216 213 <xsl:text>$TIMEZONE</xsl:text> 217 214 </xsl:when> … … 228 225 229 226 </xsl:stylesheet> 230
Note:
See TracChangeset
for help on using the changeset viewer.