Ignore:
Timestamp:
04/09/2012 10:17:30 AM (12 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs
Children:
d721466
Parents:
d6f2ebf
Message:

Change again the root commands, so that all control characters are escaped
Update the corresponding part in README.BLFS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    rd6f2ebf rf53dc4c  
    437437        <xsl:when test="@role = 'root'">
    438438          <xsl:if test="$sudo = 'y'">
    439             <xsl:text>sudo sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
     439            <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
    440440          </xsl:if>
    441           <xsl:apply-templates select="userinput" mode="root"/>
     441          <xsl:apply-templates mode="root"/>
    442442          <xsl:if test="$sudo = 'y'">
    443443            <xsl:text>&#xA;ROOT_EOF</xsl:text>
     
    505505  </xsl:template>
    506506
    507   <xsl:template match="userinput" mode="root">
    508     <xsl:for-each select="child::node()">
    509       <xsl:choose>
    510         <xsl:when test="self::text()">
    511           <xsl:call-template name="output-root">
    512             <xsl:with-param name="out-string" select="string()"/>
    513           </xsl:call-template>
    514         </xsl:when>
    515         <xsl:otherwise>
    516           <xsl:apply-templates select="self::node()"/>
    517         </xsl:otherwise>
    518       </xsl:choose>
    519     </xsl:for-each>
     507  <xsl:template match="text()" mode="root">
     508    <xsl:call-template name="output-root">
     509      <xsl:with-param name="out-string" select="string()"/>
     510    </xsl:call-template>
    520511  </xsl:template>
    521512
     
    532523          <xsl:with-param name="out-string"
    533524                          select="substring-after($out-string,'make')"/>
     525        </xsl:call-template>
     526      </xsl:when>
     527      <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
     528        <xsl:call-template name="output-root">
     529          <xsl:with-param name="out-string"
     530                          select="substring-before($out-string,'$')"/>
     531        </xsl:call-template>
     532        <xsl:text>\$</xsl:text>
     533        <xsl:call-template name="output-root">
     534          <xsl:with-param name="out-string"
     535                          select="substring-after($out-string,'$')"/>
    534536        </xsl:call-template>
    535537      </xsl:when>
     
    568570  </xsl:template>
    569571
     572  <xsl:template match="replaceable" mode="root">
     573        <xsl:text>**EDITME</xsl:text>
     574        <xsl:apply-templates/>
     575        <xsl:text>EDITME**</xsl:text>
     576  </xsl:template>
     577
    570578</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.