Replaced && by set -e.

Removed now unneeded XSL code.
This commit is contained in:
Manuel Canales Esparcia 2005-10-15 15:40:23 +00:00
parent 0fd8a9d4eb
commit fd691b473d
2 changed files with 44 additions and 51 deletions

View file

@ -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&#xA;&#xA;</xsl:text> <xsl:text>#!/tools/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@id='ch-tools-stripping' or
@id='ch-system-strippingagain'">
<xsl:text>#!/bin/sh&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text> <xsl:text>#!/bin/sh&#xA;set -e&#xA;&#xA;</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 &amp;&amp;&#xA;</xsl:text> <xsl:text>cd $PKGDIR&#xA;</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,88 +90,77 @@
<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> &#xA;</xsl:text> <xsl:text> || true&#xA;</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 &amp;&amp;&#xA;</xsl:text>
<xsl:text>cp -v ../kernel-config .config &amp;&amp;&#xA;</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> &amp;&amp;&#xA;</xsl:text> <xsl:text>&#xA;</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>&#xA;</xsl:text>
</xsl:when>
<!-- Copying the kernel config file -->
<xsl:when test="string() = 'make mrproper'">
<xsl:text>make mrproper&#xA;</xsl:text>
<xsl:text>cp -v ../kernel-config .config&#xA;</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>&#xA;</xsl:text> <xsl:text>&#xA;</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(),'&#xA;')"/>
<xsl:text> || true&#xA;</xsl:text>
<xsl:value-of select="substring-after(string(),'&#xA;')"/>
<xsl:text>&#xA;</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> &amp;&amp;&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(string(),'EOF')">
<xsl:value-of select="substring-before(string(),'cat &gt;')"/>
<xsl:text>&#xA;(&#xA;cat &lt;&lt; EOF&#xA;</xsl:text>
<xsl:apply-templates select="literal"/>
<xsl:text>&#xA;EOF&#xA;) &gt;</xsl:text>
<xsl:value-of select="substring-after((substring-before(string(),'&lt;&lt;')),'cat &gt;')"/>
<xsl:text> &amp;&amp;&#xA;</xsl:text>
<xsl:if test="string-length(substring-after(string(),'EOF&#xA;')) &gt; 0">
<xsl:value-of select="substring-after(string(),'EOF&#xA;')"/>
<xsl:text> &amp;&amp;&#xA;</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> &amp;&amp;&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:if test="not(contains(string(),'check')) and
not(contains(string(),'strip '))">
<xsl:text> &amp;&amp;</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </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> </xsl:when>
<!-- Don't stop on strip run -->
<xsl:when test="contains(string(),'strip ')">
<xsl:apply-templates/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:when>
<!-- The rest of commands -->
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>

2
jhalfs
View file

@ -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