Changeset 24ad4fd for BLFS/xsl


Ignore:
Timestamp:
03/18/2023 09:44:03 PM (16 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
6ac0d96
Parents:
5126ee3
Message:

Fix outputting too many sh <<ROOT_EOF

When installing a bootscript or a unit, this sometimes happen
(e.g. samba).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    r5126ee3 r24ad4fd  
    723723    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
    724724<!-- if the preceding "screen" tag is role="root", and we are role="root"
    725      the end-root has not been called. So do it -->
     725     the end-root has not been called, except if the preceding "screen"
     726     tag is itself preceded by a <para> containing and <xref> to
     727     bootscripts. So close it only if needed -->
    726728      <xsl:if
    727            test="preceding-sibling::screen[1][@role='root'] and @role='root'">
     729        test="preceding-sibling::screen[1][@role='root'] and
     730        @role='root' and
     731        not(preceding-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='bootscripts'])">
    728732        <xsl:call-template name="end-root"/>
    729733      </xsl:if>
     
    734738      </xsl:call-template>
    735739<!-- if the preceding "screen" tag is role="root", and we are role="root"
    736      the begin-root will not be called. So do it -->
     740     the begin-root will not be called. So do it.-->
    737741      <xsl:if
    738            test="preceding-sibling::screen[1][@role='root'] and @role='root'">
     742        test="preceding-sibling::screen[1][@role='root'] and
     743        @role='root'">
    739744        <xsl:call-template name="begin-root"/>
    740745      </xsl:if>
     
    742747    <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
    743748<!-- if the preceding "screen" tag is role="root", and we are role="root"
    744      the end-root has not been called. So do it -->
     749     the end-root has not been called. So do it, except if it was already a
     750     unit install -->
    745751      <xsl:if
    746            test="preceding-sibling::screen[1][@role='root'] and @role='root'">
     752        test="preceding-sibling::screen[1][@role='root'] and
     753        @role='root' and
     754        not(preceding-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='systemd-units'])">
    747755        <xsl:call-template name="end-root"/>
    748756      </xsl:if>
     
    753761      </xsl:call-template>
    754762<!-- if the preceding "screen" tag is role="root", and we are role="root"
    755      the begin-root will not be called. So do it -->
     763     the begin-root will not be called. So do it. -->
    756764      <xsl:if
    757            test="preceding-sibling::screen[1][@role='root'] and @role='root'">
     765        test="preceding-sibling::screen[1][@role='root'] and
     766        @role='root'">
    758767        <xsl:call-template name="begin-root"/>
    759768      </xsl:if>
     
    763772                                                  @linkend='systemd-units']">
    764773<!-- if the next "screen" tag is role="root", and we are role="root"
    765      the end-root has not been called. So do it -->
     774     the end-root has not been called. -->
    766775      <xsl:if
    767776           test="following-sibling::screen[1][@role='root'] and @role='root'">
     
    771780popd</xsl:text>
    772781<!-- if the next "screen" tag is role="root", and we are role="root"
    773      the begin-root will not be called. So do it -->
     782     the begin-root will not be called. So do it, except if the next
     783     <screen> is itself a unit or bootscript install -->
    774784      <xsl:if
    775            test="following-sibling::screen[1][@role='root'] and @role='root'">
     785        test="following-sibling::screen[1][@role='root'] and
     786        @role='root' and
     787        not(following-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='bootscripts' or @linkend='systemd-units'])">
    776788        <xsl:call-template name="begin-root"/>
    777789      </xsl:if>
Note: See TracChangeset for help on using the changeset viewer.