Author: pierre
Date: Sun May 31 00:31:32 2020
New Revision: 4163
Log:
Allows having << EOF in tests, and not generating >> $TEST_LOG... until the
matching EOF is found.
Modified:
jhalfs/trunk/LFS/lfs.xsl
Modified: jhalfs/trunk/LFS/lfs.xsl
==============================================================================
--- jhalfs/trunk/LFS/lfs.xsl Sun May 24 23:47:48 2020 (r4162)
+++ jhalfs/trunk/LFS/lfs.xsl Sun May 31 00:31:32 2020 (r4163)
@@ -1080,16 +1080,31 @@
<xsl:template name="comment-test">
<xsl:param name="instructions" select="''"/>
+ <xsl:param name="eof-seen" select="false()"/>
<xsl:choose>
<xsl:when test="contains($instructions,'
')">
<xsl:call-template name="comment-test">
<xsl:with-param name="instructions"
select="substring-before($instructions,'
')"/>
+ <xsl:with-param name="eof-seen" select="$eof-seen"/>
</xsl:call-template>
- <xsl:call-template name="comment-test">
- <xsl:with-param name="instructions"
- select="substring-after($instructions,'
')"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="contains(substring-before($instructions,'
'),
+ 'EOF')">
+ <xsl:call-template name="comment-test">
+ <xsl:with-param name="instructions"
+ select="substring-after($instructions,'
')"/>
+ <xsl:with-param name="eof-seen" select="not($eof-seen)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="comment-test">
+ <xsl:with-param name="instructions"
+ select="substring-after($instructions,'
')"/>
+ <xsl:with-param name="eof-seen" select="$eof-seen"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$testsuite = '0' or
@@ -1108,21 +1123,28 @@
<xsl:choose>
<xsl:when test="contains(string(), 'make -k')">
<xsl:value-of select="$instructions"/>
- <xsl:text> >> $TEST_LOG 2>&1 ||
true
</xsl:text>
+ <xsl:if test="not($eof-seen)">
+ <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
+ </xsl:if>
+ <xsl:text>
</xsl:text>
</xsl:when>
<xsl:when test="contains($instructions, 'make')">
<xsl:value-of select="substring-before($instructions,
'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after($instructions, 'make')"/>
- <xsl:text> >> $TEST_LOG 2>&1 ||
true
</xsl:text>
+ <xsl:if test="not($eof-seen)">
+ <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
+ </xsl:if>
+ <xsl:text>
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$instructions"/>
<xsl:if
test="not(contains($instructions, '>>')) and
+ not($eof-seen) and
substring($instructions,
string-length($instructions)) != '\'">
- <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
+ <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:otherwise>
@@ -1133,11 +1155,15 @@
<xsl:choose>
<xsl:when test="contains($instructions, 'make -k')">
<xsl:value-of select="$instructions"/>
- <xsl:text> >> $TEST_LOG 2>&1 ||
true
</xsl:text>
+ <xsl:if test="not($eof-seen)">
+ <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
+ </xsl:if>
+ <xsl:text>
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$instructions"/>
<xsl:if test="not(contains($instructions, '>>')) and
+ not($eof-seen) and
substring($instructions,
string-length($instructions)) != '\'">
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
--
http://lists.linuxfromscratch.org/listinfo/alfs-log
Unsubscribe: See the above information page