Ignore:
Timestamp:
03/01/2017 03:54:16 PM (8 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, trunk
Children:
84440e6
Parents:
fbdd1a8
Message:

Install units when revision is systemd, rather than bootscripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    rfbdd1a8 r70d73d1  
    1010<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
    1111
     12<!-- Check whether the book is sysv or systemd -->
     13  <xsl:variable name="rev">
     14    <xsl:choose>
     15      <xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
     16        systemd
     17      </xsl:when>
     18      <xsl:otherwise>
     19        sysv
     20      </xsl:otherwise>
     21    </xsl:choose>
     22  </xsl:variable>
     23
    1224  <!-- Build as user (y) or as root (n)? -->
    1325  <xsl:param name="sudo" select="'y'"/>
     
    2133  <xsl:template match="sect1">
    2234
    23     <xsl:if test="@id != 'bootscripts'">
     35    <xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
    2436        <!-- The file names -->
    2537      <xsl:variable name="filename" select="@id"/>
     
    403415  </xsl:template>
    404416
    405   <xsl:template match="screen" mode="config">
    406     <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
    407       <xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] &amp;&amp; mkdir $SRC_DIR/blfs-bootscripts
    408 pushd $SRC_DIR/blfs-bootscripts
     417  <xsl:template name="set-bootpkg-dir">
     418    <xsl:param name="bootpkg" select="'bootscripts'"/>
     419    <xsl:param name="url" select="''"/>
     420    <xsl:text>[[ ! -d $SRC_DIR/blfs-</xsl:text>
     421    <xsl:copy-of select="$bootpkg"/>
     422    <xsl:text> ]] &amp;&amp; mkdir $SRC_DIR/blfs-</xsl:text>
     423    <xsl:copy-of select="$bootpkg"/>
     424    <xsl:text>
     425pushd $SRC_DIR/blfs-</xsl:text>
     426    <xsl:copy-of select="$bootpkg"/>
     427    <xsl:text>
    409428URL=</xsl:text>
    410       <xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text>
     429      <xsl:value-of select="$url"/>
     430    <xsl:text>
    411431BOOTPACKG=$(basename $URL)
    412432if [[ ! -f $BOOTPACKG ]] ; then
     
    435455cd $BOOTUNPACKDIR
    436456</xsl:text>
     457  </xsl:template>
     458
     459  <xsl:template match="screen" mode="config">
     460    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
     461      <xsl:call-template name="set-bootpkg-dir">
     462        <xsl:with-param name="bootpkg" select="'bootscripts'"/>
     463        <xsl:with-param name="url"
     464                        select="id('bootscripts')//itemizedlist//ulink/@url"/>
     465      </xsl:call-template>
     466    </xsl:if>
     467    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
     468      <xsl:call-template name="set-bootpkg-dir">
     469        <xsl:with-param name="bootpkg" select="'systemd-units'"/>
     470        <xsl:with-param name="url"
     471                        select="id('systemd-units')//itemizedlist//ulink/@url"/>
     472      </xsl:call-template>
    437473    </xsl:if>
    438474    <xsl:apply-templates select='.'/>
    439     <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
     475    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
     476                                                  @linkend='systemd-units']">
    440477      <xsl:text>
    441478popd</xsl:text>
Note: See TracChangeset for help on using the changeset viewer.