Revised CLFS2 XSL code.
This commit is contained in:
parent
963fdae00d
commit
cfaeeb4e6b
2 changed files with 8 additions and 95 deletions
|
@ -11,21 +11,11 @@
|
|||
extension-element-prefixes="exsl"
|
||||
version="1.0">
|
||||
|
||||
<!-- XSLT stylesheet to create shell scripts from CLFS books. -->
|
||||
|
||||
<!-- Build method used -->
|
||||
<xsl:param name="method" select="chroot"/>
|
||||
<!-- XSLT stylesheet to create shell scripts from CLFS2 books. -->
|
||||
|
||||
<!-- Compile the keymap into the kernel? -->
|
||||
<xsl:param name="keymap" select="none"/>
|
||||
|
||||
<!-- Run test suites?
|
||||
0 = none
|
||||
1 = only Glibc, GCC and Binutils testsuites
|
||||
2 = all testsuites
|
||||
3 = alias to 2 -->
|
||||
<xsl:param name="testsuite" select="0"/>
|
||||
|
||||
<!-- Install vim-lang package? -->
|
||||
<xsl:param name="vim-lang" select="1"/>
|
||||
|
||||
|
@ -47,7 +37,6 @@
|
|||
<xsl:when test="../@id='chapter-partitioning' or
|
||||
../@id='chapter-getting-materials' or
|
||||
../@id='chapter-final-preps'"/>
|
||||
<xsl:when test="../@id='chapter-testsuite-tools' and $testsuite='0'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="count(descendant::screen/userinput) > 0 and
|
||||
count(descendant::screen/userinput) >
|
||||
|
@ -80,17 +69,10 @@
|
|||
</xsl:variable>
|
||||
<!-- Creating dirs and files -->
|
||||
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
||||
<xsl:choose>
|
||||
<xsl:when test="../@id='chapter-chroot'">
|
||||
<xsl:text>#!/tools/bin/bash
set -e

</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@id='ch-system-stripping'">
|
||||
<xsl:text>#!/bin/sh
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>#!/bin/sh
set -e

</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="not(@id='ch-system-stripping')">
|
||||
<xsl:text>set -e

</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="sect2[@role='installation']">
|
||||
<xsl:text>cd $PKGDIR
</xsl:text>
|
||||
<xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
|
||||
|
@ -111,16 +93,7 @@
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="para/userinput">
|
||||
<xsl:if test="(contains(string(),'test') or
|
||||
contains(string(),'check')) and
|
||||
($testsuite = '2' or $testsuite = '3')">
|
||||
<xsl:value-of select="substring-before(string(),'make')"/>
|
||||
<xsl:text>make -k</xsl:text>
|
||||
<xsl:value-of select="substring-after(string(),'make')"/>
|
||||
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<xsl:template match="para/userinput"/>
|
||||
|
||||
<xsl:template match="userinput" mode="screen">
|
||||
<xsl:choose>
|
||||
|
@ -131,13 +104,6 @@
|
|||
<xsl:value-of select="substring-after(string(),'tar.gz')"/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- Avoiding a race condition in a patch -->
|
||||
<xsl:when test="contains(string(),'debian_fixes')">
|
||||
<xsl:value-of select="substring-before(string(),'patch')"/>
|
||||
<xsl:text>patch -Z</xsl:text>
|
||||
<xsl:value-of select="substring-after(string(),'patch')"/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- Setting $LANG for /etc/profile -->
|
||||
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
|
||||
contains(string(),'export LANG=')">
|
||||
|
@ -153,60 +119,10 @@
|
|||
<!-- Copying the kernel config file -->
|
||||
<xsl:when test="string() = 'make mrproper'">
|
||||
<xsl:text>make mrproper
</xsl:text>
|
||||
<xsl:if test="ancestor::sect1[@id='ch-boot-kernel']">
|
||||
<xsl:text>cp -v ../bootkernel-config .config
</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
||||
<xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<!-- No interactive commands are needed if the .config file is the proper one -->
|
||||
<xsl:when test="contains(string(),'menuconfig')"/>
|
||||
<!-- The Coreutils and Module-Init-Tools test suites are optional -->
|
||||
<xsl:when test="(ancestor::sect1[@id='ch-system-coreutils'] or
|
||||
ancestor::sect1[@id='ch-system-module-init-tools']) and
|
||||
(contains(string(),'check') or
|
||||
contains(string(),'dummy'))">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$testsuite = '0' or $testsuite = '1'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:if test="contains(string(),'check')">
|
||||
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<!-- Fixing toolchain test suites run -->
|
||||
<xsl:when test="string() = 'make check' or
|
||||
string() = 'make -k check'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$testsuite != '0'">
|
||||
<xsl:text>make -k check >> $TEST_LOG 2>&1 || true
</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'glibc-check-log')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$testsuite != '0'">
|
||||
<xsl:value-of select="substring-before(string(),'>g')"/>
|
||||
<xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'test_summary') or
|
||||
contains(string(),'expect -c')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$testsuite != '0'">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:if test="contains(string(),'test_summary')">
|
||||
<xsl:text> >> $TEST_LOG</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<!-- Don't stop on strip run -->
|
||||
<xsl:when test="contains(string(),'strip ')">
|
||||
<xsl:apply-templates/>
|
||||
|
@ -228,8 +144,7 @@
|
|||
<xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
||||
<xsl:value-of select="$page"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::sect1[@id='ch-boot-kernel'] or
|
||||
ancestor::sect1[@id='ch-bootable-kernel']">
|
||||
<xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
||||
<xsl:value-of select="$keymap"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
|
|
@ -740,8 +740,6 @@ extract_commands() { #
|
|||
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
||||
xsltproc --nonet \
|
||||
--xinclude \
|
||||
--stringparam testsuite $TEST \
|
||||
--stringparam bomb-testsuite $BOMB_TEST \
|
||||
--stringparam vim-lang $VIMLANG \
|
||||
--stringparam timezone $TIMEZONE \
|
||||
--stringparam page $PAGE \
|
||||
|
|
Reference in a new issue