Changeset eb8667a for BLFS


Ignore:
Timestamp:
03/01/2017 04:07:26 PM (8 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
new_features
Children:
796cd28
Parents:
50a8ed0
Message:

Install units rather than bootscripts when REV=systemd

Location:
BLFS/xsl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/make_book.xsl

    r50a8ed0 reb8667a  
    88  <xsl:param name="list" select="''"/>
    99  <xsl:param name="MTA" select="'sendmail'"/>
     10
     11<!-- Check whether the book is sysv or systemd -->
     12  <xsl:variable name="rev">
     13    <xsl:choose>
     14      <xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
     15        <xsl:text>systemd</xsl:text>
     16      </xsl:when>
     17      <xsl:otherwise>
     18        <xsl:text>sysv</xsl:text>
     19      </xsl:otherwise>
     20    </xsl:choose>
     21  </xsl:variable>
    1022
    1123  <xsl:output
     
    2032        <?dbhtml filename="preface.html"?>
    2133        <title>Preface</title>
    22         <xsl:copy-of select="id('bootscripts')"/>
     34        <xsl:choose>
     35          <xsl:when test="$rev='sysv'">
     36            <xsl:copy-of select="id('bootscripts')"/>
     37          </xsl:when>
     38          <xsl:otherwise>
     39            <xsl:copy-of select="id('systemd-units')"/>
     40          </xsl:otherwise>
     41        </xsl:choose>
    2342      </preface>
    2443      <chapter>
     
    113132          <xsl:otherwise>
    114133            <xsl:choose>
    115               <xsl:when test="@linkend='bootscripts'">
     134              <xsl:when test="@linkend='bootscripts' or
     135                              @linkend='systemd-units'">
    116136                <xsl:copy-of select="."/>
    117137              </xsl:when>
  • BLFS/xsl/scripts.xsl

    r50a8ed0 reb8667a  
    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  <!-- Wrap "root" commands inside a wrapper function, allowing
    1325       "porg style" package management -->
     
    2537  <xsl:template match="sect1">
    2638
    27     <xsl:if test="@id != 'bootscripts'">
     39    <xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
    2840        <!-- The file names -->
    2941      <xsl:variable name="filename" select="@id"/>
     
    428440  </xsl:template>
    429441
    430   <xsl:template match="screen" mode="config">
    431     <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
    432       <xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] &amp;&amp; mkdir $SRC_DIR/blfs-bootscripts
    433 pushd $SRC_DIR/blfs-bootscripts
     442  <xsl:template name="set-bootpkg-dir">
     443    <xsl:param name="bootpkg" select="'bootscripts'"/>
     444    <xsl:param name="url" select="''"/>
     445    <xsl:text>[[ ! -d $SRC_DIR/blfs-</xsl:text>
     446    <xsl:copy-of select="$bootpkg"/>
     447    <xsl:text> ]] &amp;&amp; mkdir $SRC_DIR/blfs-</xsl:text>
     448    <xsl:copy-of select="$bootpkg"/>
     449    <xsl:text>
     450pushd $SRC_DIR/blfs-</xsl:text>
     451    <xsl:copy-of select="$bootpkg"/>
     452    <xsl:text>
    434453URL=</xsl:text>
    435       <xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text>
     454      <xsl:value-of select="$url"/>
     455    <xsl:text>
    436456BOOTPACKG=$(basename $URL)
    437457if [[ ! -f $BOOTPACKG ]] ; then
     
    460480cd $BOOTUNPACKDIR
    461481</xsl:text>
     482  </xsl:template>
     483
     484  <xsl:template match="screen" mode="config">
     485    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
     486      <xsl:call-template name="set-bootpkg-dir">
     487        <xsl:with-param name="bootpkg" select="'bootscripts'"/>
     488        <xsl:with-param name="url"
     489                        select="id('bootscripts')//itemizedlist//ulink/@url"/>
     490      </xsl:call-template>
     491    </xsl:if>
     492    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
     493      <xsl:call-template name="set-bootpkg-dir">
     494        <xsl:with-param name="bootpkg" select="'systemd-units'"/>
     495        <xsl:with-param name="url"
     496                        select="id('systemd-units')//itemizedlist//ulink/@url"/>
     497      </xsl:call-template>
    462498    </xsl:if>
    463499    <xsl:apply-templates select='.'/>
    464     <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
     500    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
     501                                                  @linkend='systemd-units']">
    465502      <xsl:text>
    466503popd</xsl:text>
Note: See TracChangeset for help on using the changeset viewer.