Changeset 4762fb9 for LFS


Ignore:
Timestamp:
03/29/2020 03:13:15 PM (4 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
3261fe7
Parents:
903eefd
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LFS/lfs.xsl

    r903eefd r4762fb9  
    9090<!-- End parameters -->
    9191
     92<!-- bashdir is used at the beginning of chapter 6, for the #! line.
     93  If we created a /tools directory in chapter 4, bash is in /tools/bin,
     94otherwise it is in /bin.-->
     95  <xsl:variable name="bashdir">
     96    <xsl:choose>
     97      <xsl:when test="//sect1[@id='ch-tools-creatingtoolsdir']">
     98        <xsl:text>/tools</xsl:text>
     99      </xsl:when>
     100      <xsl:otherwise>
     101        <xsl:text></xsl:text>
     102      </xsl:otherwise>
     103    </xsl:choose>
     104  </xsl:variable>
    92105  <xsl:template match="/">
    93106    <xsl:apply-templates select="//sect1[not(@revision) or
     
    159172    <!-- Creating dirs and files -->
    160173    <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
    161       <xsl:choose>
    162         <xsl:when test="@id='ch-system-creatingdirs' or
    163                         @id='ch-system-createfiles' or
    164                         @id='ch-system-strippingagain'">
    165           <xsl:text>#!/tools/bin/bash&#xA;set +h&#xA;</xsl:text>
    166         </xsl:when>
    167         <xsl:otherwise>
    168           <xsl:text>#!/bin/bash&#xA;set +h&#xA;</xsl:text>
    169         </xsl:otherwise>
    170       </xsl:choose>
     174      <xsl:text>#!</xsl:text>
     175      <xsl:if test="@id='ch-system-creatingdirs' or
     176                    @id='ch-system-createfiles' or
     177                    @id='ch-system-strippingagain'">
     178        <xsl:copy-of select="$bashdir"/>
     179      </xsl:if>
     180      <xsl:text>/bin/bash&#xA;set +h&#xA;</xsl:text>
    171181      <xsl:if test="not(@id='ch-tools-stripping') and
    172182                    not(@id='ch-system-strippingagain')">
Note: See TracChangeset for help on using the changeset viewer.