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

</xsl:text>
|
<xsl:text>set -e

</xsl:text>
|
||||||
</xsl:when>
|
</xsl:if>
|
||||||
<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="sect2[@role='installation']">
|
<xsl:if test="sect2[@role='installation']">
|
||||||
<xsl:text>cd $PKGDIR
</xsl:text>
|
<xsl:text>cd $PKGDIR
</xsl:text>
|
||||||
<xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
|
<xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
|
||||||
|
@ -111,16 +93,7 @@
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="para/userinput">
|
<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="userinput" mode="screen">
|
<xsl:template match="userinput" mode="screen">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
|
@ -131,13 +104,6 @@
|
||||||
<xsl:value-of select="substring-after(string(),'tar.gz')"/>
|
<xsl:value-of select="substring-after(string(),'tar.gz')"/>
|
||||||
<xsl:text>
</xsl:text>
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</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 -->
|
<!-- Setting $LANG for /etc/profile -->
|
||||||
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
|
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
|
||||||
contains(string(),'export LANG=')">
|
contains(string(),'export LANG=')">
|
||||||
|
@ -153,60 +119,10 @@
|
||||||
<!-- Copying the kernel config file -->
|
<!-- Copying the kernel config file -->
|
||||||
<xsl:when test="string() = 'make mrproper'">
|
<xsl:when test="string() = 'make mrproper'">
|
||||||
<xsl:text>make mrproper
</xsl:text>
|
<xsl:text>make mrproper
</xsl:text>
|
||||||
<xsl:if test="ancestor::sect1[@id='ch-boot-kernel']">
|
<xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
||||||
<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>
|
</xsl:when>
|
||||||
<!-- No interactive commands are needed if the .config file is the proper one -->
|
<!-- No interactive commands are needed if the .config file is the proper one -->
|
||||||
<xsl:when test="contains(string(),'menuconfig')"/>
|
<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 -->
|
<!-- Don't stop on strip run -->
|
||||||
<xsl:when test="contains(string(),'strip ')">
|
<xsl:when test="contains(string(),'strip ')">
|
||||||
<xsl:apply-templates/>
|
<xsl:apply-templates/>
|
||||||
|
@ -228,8 +144,7 @@
|
||||||
<xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
<xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
||||||
<xsl:value-of select="$page"/>
|
<xsl:value-of select="$page"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="ancestor::sect1[@id='ch-boot-kernel'] or
|
<xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
||||||
ancestor::sect1[@id='ch-bootable-kernel']">
|
|
||||||
<xsl:value-of select="$keymap"/>
|
<xsl:value-of select="$keymap"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
|
|
|
@ -740,8 +740,6 @@ extract_commands() { #
|
||||||
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
|
||||||
xsltproc --nonet \
|
xsltproc --nonet \
|
||||||
--xinclude \
|
--xinclude \
|
||||||
--stringparam testsuite $TEST \
|
|
||||||
--stringparam bomb-testsuite $BOMB_TEST \
|
|
||||||
--stringparam vim-lang $VIMLANG \
|
--stringparam vim-lang $VIMLANG \
|
||||||
--stringparam timezone $TIMEZONE \
|
--stringparam timezone $TIMEZONE \
|
||||||
--stringparam page $PAGE \
|
--stringparam page $PAGE \
|
||||||
|
|
Reference in a new issue