diff options
author | Pierre Labastie <pierre@linuxfromscratch.org> | 2018-05-12 11:29:29 +0000 |
---|---|---|
committer | Pierre Labastie <pierre@linuxfromscratch.org> | 2018-05-12 11:29:29 +0000 |
commit | e967368f987a00e3a9747d5f5f69c5f9fbfce069 (patch) | |
tree | 07bfb539aa35680b2980598dea5987fbdcfd47d5 | |
parent | 56a5508dcdfd52e28596b828cc69a9c50ae9cbad (diff) |
Fix generation of chroot instructions for newer LFS book2.4
-rw-r--r-- | common/chroot.xsl | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/common/chroot.xsl b/common/chroot.xsl index a42adc0e3e..d5aa46ecbb 100644 --- a/common/chroot.xsl +++ b/common/chroot.xsl @@ -14,7 +14,8 @@ <xsl:template match="sect1"> <xsl:if - test="descendant::screen/userinput[starts-with(string(),'chroot')]"> + test="descendant::screen/userinput[contains(string(),'
chroot') or + starts-with(string(),'chroot')]"> <!-- The file names --> <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/> <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/> @@ -39,14 +40,51 @@ <!-- Creating dirs and files --> <exsl:document href="{$order}-{$filename}" method="text"> <xsl:text>#!/bin/bash
</xsl:text> - <xsl:apply-templates select=".//userinput[starts-with(string(),'chroot')]"/> + <xsl:apply-templates + select=".//userinput[contains(string(),'
chroot') or + starts-with(string(),'chroot')]"/> <xsl:text>exit
</xsl:text> </exsl:document> </xsl:if> </xsl:template> <xsl:template match="userinput"> - <xsl:apply-templates/> - <xsl:text>
</xsl:text> + <xsl:call-template name="extract-chroot"> + <xsl:with-param name="instructions" select="string()"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="extract-chroot"> + <xsl:param name="instructions" select="''"/> + <xsl:choose> + <xsl:when test="not(starts-with($instructions,'
chroot')) and + contains($instructions, '
chroot')"> + <xsl:call-template name="extract-chroot"> + <xsl:with-param name="instructions" + select="substring(substring-after($instructions, + substring-before($instructions, + '
chroot')),2)"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="contains($instructions,'\
')"> + <xsl:copy-of select="substring-before($instructions,'\
')"/> + <xsl:text>\ +</xsl:text> + <xsl:call-template name="extract-chroot"> + <xsl:with-param name="instructions" + select="substring-after($instructions,'\
')"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="contains($instructions,'
')"> + <xsl:copy-of select="substring-before($instructions,'
')"/> + <xsl:text> +</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$instructions"/> + <xsl:text> +</xsl:text> + </xsl:otherwise> + </xsl:choose> </xsl:template> </xsl:stylesheet> |