Replaced && by set -e.
Removed now unneeded XSL code.
This commit is contained in:
parent
0fd8a9d4eb
commit
fd691b473d
2 changed files with 44 additions and 51 deletions
|
@ -51,16 +51,20 @@
|
|||
<xsl:when test="@id='ch-system-changingowner' or
|
||||
@id='ch-system-creatingdirs' or
|
||||
@id='ch-system-createfiles'">
|
||||
<xsl:text>#!/tools/bin/bash

</xsl:text>
|
||||
<xsl:text>#!/tools/bin/bash
set -e

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

</xsl:text>
|
||||
<xsl:text>#!/bin/sh
set -e

</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="sect2[@role='installation'] or
|
||||
@id='ch-tools-adjusting' or
|
||||
@id='ch-system-readjusting'">
|
||||
<xsl:text>cd $PKGDIR &&
</xsl:text>
|
||||
<xsl:text>cd $PKGDIR
</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select=".//para/userinput | .//screen"/>
|
||||
<xsl:text>exit</xsl:text>
|
||||
|
@ -86,88 +90,77 @@
|
|||
<xsl:value-of select="substring-before(string(),'make')"/>
|
||||
<xsl:text>make -k</xsl:text>
|
||||
<xsl:value-of select="substring-after(string(),'make')"/>
|
||||
<xsl:text> 
</xsl:text>
|
||||
<xsl:text> || true
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="userinput" mode="screen">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string() = 'make mrproper'">
|
||||
<xsl:text>make mrproper &&
</xsl:text>
|
||||
<xsl:text>cp -v ../kernel-config .config &&
</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- Estandarized package formats -->
|
||||
<xsl:when test="contains(string(),'tar.gz')">
|
||||
<xsl:value-of select="substring-before(string(),'tar.gz')"/>
|
||||
<xsl:text>tar.bz2</xsl:text>
|
||||
<xsl:value-of select="substring-after(string(),'tar.gz')"/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
<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>
|
||||
<!-- Copying the kernel config file -->
|
||||
<xsl:when test="string() = 'make mrproper'">
|
||||
<xsl:text>make mrproper
</xsl:text>
|
||||
<xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- The Coreutils test suite is optional -->
|
||||
<xsl:when test="$testsuite = '0' and
|
||||
ancestor::sect1[@id='ch-system-coreutils'] and
|
||||
(contains(string(),'check') or
|
||||
contains(string(),'dummy'))"/>
|
||||
<!-- Fixing toolchain test suites run -->
|
||||
<xsl:when test="string() = 'make check' or
|
||||
string() = 'make -k check'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$toolchaintest = '0'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>make -k check</xsl:text>
|
||||
<xsl:text>make -k check || true</xsl:text>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'glibc-check-log') or
|
||||
contains(string(),'test_summary') or
|
||||
<xsl:when test="contains(string(),'glibc-check-log')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$toolchaintest = '0'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="substring-before(string(),'
')"/>
|
||||
<xsl:text> || true
</xsl:text>
|
||||
<xsl:value-of select="substring-after(string(),'
')"/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'test_summary') or
|
||||
contains(string(),'expect -c')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$toolchaintest = '0'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'EOF')">
|
||||
<xsl:value-of select="substring-before(string(),'cat >')"/>
|
||||
<xsl:text>
(
cat << EOF
</xsl:text>
|
||||
<xsl:apply-templates select="literal"/>
|
||||
<xsl:text>
EOF
) ></xsl:text>
|
||||
<xsl:value-of select="substring-after((substring-before(string(),'<<')),'cat >')"/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
<xsl:if test="string-length(substring-after(string(),'EOF
')) > 0">
|
||||
<xsl:value-of select="substring-after(string(),'EOF
')"/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<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>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:if test="not(contains(string(),'check')) and
|
||||
not(contains(string(),'strip '))">
|
||||
<xsl:text> &&</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="literal">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(string(),'$@')">
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring-before(string($content),'$@')"/>
|
||||
<xsl:text>\$@</xsl:text>
|
||||
<xsl:value-of select="substring-after(string($content),'$@')"/>
|
||||
</xsl:when>
|
||||
<!-- Don't stop on strip run -->
|
||||
<xsl:when test="contains(string(),'strip ')">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text> || true
</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- The rest of commands -->
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
|
2
jhalfs
2
jhalfs
|
@ -836,7 +836,7 @@ EOF
|
|||
i=1
|
||||
for file in chapter06/*chroot* ; do
|
||||
chroot=`cat $file | sed -e '/#!\/bin\/sh/d' -e 's@ \\\@ @g' | tr -d '\n' | sed \
|
||||
-e 's/ */ /g' -e 's|\\$|&&|g' -e 's|&&exit||g' -e 's|$| -c|' -e 's|"$$LFS"|$(LFS)|'`
|
||||
-e 's/ */ /g' -e 's|\\$|&&|g' -e 's|exit||g' -e 's|$| -c|' -e 's|"$$LFS"|$(LFS)|'`
|
||||
echo -e "CHROOT$i= $chroot\n" >> $MKFILE
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
|
|
Reference in a new issue