Ignore:
Timestamp:
04/09/2017 10:29:32 AM (7 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
cee84ad
Parents:
909ee37
Message:

Merge the new_features branch (manully, thanks to svn)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    r909ee37 r945ccaa  
    2121    </xsl:choose>
    2222  </xsl:variable>
     23
     24  <!-- Wrap "root" commands inside a wrapper function, allowing
     25       "porg style" package management -->
     26  <xsl:param name="wrap-install" select="'n'"/>
    2327
    2428  <!-- Build as user (y) or as root (n)? -->
     
    7074          <!-- Package page -->
    7175          <xsl:when test="sect2[@role='package']">
    72             <!-- We build in a subdirectory -->
    73             <xsl:text>PKG_DIR=</xsl:text>
     76            <!-- We build in a subdirectory, whose name may be needed
     77                 if using package management (see envars.conf), so
     78                 "export" it -->
     79            <xsl:text>export PKG_DIR=</xsl:text>
    7480            <xsl:value-of select="$filename"/>
    7581            <xsl:text>
     
    150156     ;;
    151157esac
     158export UNPACKDIR
    152159cd $UNPACKDIR&#xA;
    153160</xsl:text>
     
    408415      <xsl:choose>
    409416        <xsl:when test="@role = 'root'">
    410           <xsl:if test="$sudo = 'y'">
    411             <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
     417          <xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
     418            <xsl:if test="$sudo = 'y'">
     419              <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
     420            </xsl:if>
     421            <xsl:if test="$wrap-install = 'y' and
     422                          ancestor::sect2[@role='installation']">
     423              <xsl:text>if [ -r "$PACK_INSTALL" ]; then
     424  source $PACK_INSTALL
     425  export -f wrapInstall
     426  export -f packInstall
     427fi
     428wrapInstall '
     429</xsl:text>
     430            </xsl:if>
    412431          </xsl:if>
    413432          <xsl:apply-templates mode="root"/>
    414           <xsl:if test="$sudo = 'y'">
    415             <xsl:text>&#xA;ROOT_EOF</xsl:text>
     433          <xsl:if test="not(following-sibling::screen[1][@role='root'])">
     434            <xsl:if test="$wrap-install = 'y' and
     435                          ancestor::sect2[@role='installation']">
     436              <xsl:text>'&#xA;packInstall</xsl:text>
     437            </xsl:if>
     438            <xsl:if test="$sudo = 'y'">
     439              <xsl:text>&#xA;ROOT_EOF</xsl:text>
     440            </xsl:if>
    416441          </xsl:if>
    417442        </xsl:when>
     
    515540  </xsl:template>
    516541
     542  <xsl:variable name="APOS">'</xsl:variable>
     543
    517544  <xsl:template name="output-root">
    518545    <xsl:param name="out-string" select="''"/>
     
    562589        </xsl:call-template>
    563590      </xsl:when>
     591      <xsl:when test="contains($out-string,string($APOS))
     592                      and $wrap-install = 'y'
     593                      and ancestor::sect2[@role='installation']">
     594        <xsl:call-template name="output-root">
     595          <xsl:with-param name="out-string"
     596                          select="substring-before($out-string,string($APOS))"/>
     597        </xsl:call-template>
     598        <xsl:text>'\''</xsl:text>
     599        <xsl:call-template name="output-root">
     600          <xsl:with-param name="out-string"
     601                          select="substring-after($out-string,string($APOS))"/>
     602        </xsl:call-template>
     603      </xsl:when>
    564604      <xsl:otherwise>
    565605        <xsl:value-of select="$out-string"/>
Note: See TracChangeset for help on using the changeset viewer.