Fix generation of chroot instructions for newer LFS book
This commit is contained in:
parent
56a5508dcd
commit
e967368f98
1 changed files with 42 additions and 4 deletions
|
@ -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>
|
||||
|
|
Reference in a new issue