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
|
<xsl:when test="@id='ch-system-changingowner' or
|
||||||
@id='ch-system-creatingdirs' or
|
@id='ch-system-creatingdirs' or
|
||||||
@id='ch-system-createfiles'">
|
@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:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:text>#!/bin/sh

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

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