Set the correct #! executable in creat* scriptlets
Those scriptlets need to use a temporary bash, which is in /tools/bin for current LFS. But if we use a new method (cross-compiling + sysroot) it ends into /bin. So we have to set the correct `#!' header in both cases. We rely on the pesence of a "creatingtoolsdir" sect1 to know that bash is in /tools
This commit is contained in:
parent
903eefd093
commit
4762fb9900
1 changed files with 20 additions and 10 deletions
26
LFS/lfs.xsl
26
LFS/lfs.xsl
|
@ -89,6 +89,19 @@
|
||||||
|
|
||||||
<!-- End parameters -->
|
<!-- End parameters -->
|
||||||
|
|
||||||
|
<!-- bashdir is used at the beginning of chapter 6, for the #! line.
|
||||||
|
If we created a /tools directory in chapter 4, bash is in /tools/bin,
|
||||||
|
otherwise it is in /bin.-->
|
||||||
|
<xsl:variable name="bashdir">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="//sect1[@id='ch-tools-creatingtoolsdir']">
|
||||||
|
<xsl:text>/tools</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:text></xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<xsl:apply-templates select="//sect1[not(@revision) or
|
<xsl:apply-templates select="//sect1[not(@revision) or
|
||||||
@revision=$revision]"/>
|
@revision=$revision]"/>
|
||||||
|
@ -158,16 +171,13 @@
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<!-- Creating dirs and files -->
|
<!-- Creating dirs and files -->
|
||||||
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
||||||
<xsl:choose>
|
<xsl:text>#!</xsl:text>
|
||||||
<xsl:when test="@id='ch-system-creatingdirs' or
|
<xsl:if test="@id='ch-system-creatingdirs' or
|
||||||
@id='ch-system-createfiles' or
|
@id='ch-system-createfiles' or
|
||||||
@id='ch-system-strippingagain'">
|
@id='ch-system-strippingagain'">
|
||||||
<xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
<xsl:copy-of select="$bashdir"/>
|
||||||
</xsl:when>
|
</xsl:if>
|
||||||
<xsl:otherwise>
|
<xsl:text>/bin/bash
set +h
</xsl:text>
|
||||||
<xsl:text>#!/bin/bash
set +h
</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:if test="not(@id='ch-tools-stripping') and
|
<xsl:if test="not(@id='ch-tools-stripping') and
|
||||||
not(@id='ch-system-strippingagain')">
|
not(@id='ch-system-strippingagain')">
|
||||||
<xsl:text>set -e
</xsl:text>
|
<xsl:text>set -e
</xsl:text>
|
||||||
|
|
Reference in a new issue