Ignore:
Timestamp:
06/15/2019 03:26:23 PM (5 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
cf2f109
Parents:
77a8042
Message:

Various fixes and improvements coming from github:

  • the case for "pax" in packInstall.sh.prog
  • an error in packageManager.xml.porg (comment before <?xml?> tag)
  • a non-working $Id in Makefile
  • some fixes for using the sect1info in lfs (in BLFS tools)
  • a big rewrite for generating scripts with more consistent line spacing, opening the way to manage remap="test" and remap="doc" attributes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/gen-install.xsl

    r77a8042 r619b313  
    77
    88  <xsl:template match="screen" mode="installation">
     9    <xsl:param name="want-stats" select="false"/>
    910<!-- "nature" variables:
    1011      - 'non-root': executable as user
     
    3637
    3738    <xsl:variable
     39         name="prec-screen"
     40         select="preceding::screen[not(@role='nodump') and ./userinput][1]
     41                        [ancestor::sect2 = current()/ancestor::sect2]"/>
     42
     43    <xsl:variable
    3844         name="prec-string"
    39          select="string(preceding-sibling::screen[not(@role='nodump') and
    40                                                       ./userinput][1])"/>
     45         select="string($prec-screen)"/>
     46
    4147<!--
    4248    <xsl:message>
     
    6167        <xsl:when
    6268             test="$prec-string='' or
    63                    (preceding-sibling::screen[not(@role='nodump') and
    64                                                       ./userinput] |
    65                     preceding-sibling::para/command[contains(text(),'check') or
    66                                                     contains(text(),'test')]
     69                   (preceding::screen[not(@role='nodump') and
     70                                                 ./userinput] |
     71                    preceding::command[contains(text(),'check') or
     72                                       contains(text(),'test')]
    6773                   )[last()][self::command]">
    6874          <xsl:text>none</xsl:text>
    6975        </xsl:when>
    70         <xsl:when
    71            test="preceding-sibling::screen
    72                     [not(@role='nodump') and ./userinput][1][not(@role)]">
     76        <xsl:when test="$prec-screen[not(@role)]">
    7377          <xsl:text>non-root</xsl:text>
    7478        </xsl:when>
     
    9195
    9296    <xsl:variable
     97         name="follow-screen"
     98         select="following::screen[not(@role='nodump') and ./userinput][1]
     99                        [ancestor::sect2 = current()/ancestor::sect2]"/>
     100
     101    <xsl:variable
    93102         name="follow-string"
    94          select="string(following-sibling::screen[not(@role='nodump') and
    95                                                       ./userinput][1])"/>
     103         select="string($follow-screen)"/>
    96104
    97105    <xsl:variable name="follow-nature">
     
    99107        <xsl:when
    100108             test="$follow-string='' or
    101                    (following-sibling::screen[not(@role='nodump') and
    102                                                       ./userinput] |
    103                     following-sibling::para/command[contains(text(),'check') or
    104                                                     contains(text(),'test')]
     109                   (following::screen[not(@role='nodump') and
     110                                                 ./userinput] |
     111                    following::command[contains(text(),'check') or
     112                                       contains(text(),'test')]
    105113                   )[1][self::command]">
    106114          <xsl:text>none</xsl:text>
    107115        </xsl:when>
    108         <xsl:when
    109            test="following-sibling::screen
    110                     [not(@role='nodump') and ./userinput][1][not(@role)]">
     116        <xsl:when test="$follow-screen[not(@role)]">
    111117          <xsl:text>non-root</xsl:text>
    112118        </xsl:when>
     
    138144        </xsl:if>
    139145        <xsl:apply-templates/>
    140         <xsl:text>
    141 </xsl:text>
    142146      </xsl:when>
    143147
     
    150154        </xsl:if>
    151155        <xsl:apply-templates mode="root"/>
    152         <xsl:text>
    153 </xsl:text>
    154156        <xsl:if test="$follow-nature='none'">
    155157          <xsl:call-template name="end-root"/>
     
    159161      <xsl:when test="$my-nature='install'">
    160162        <xsl:if test="$prec-nature='none' or $prec-nature='non-root'">
    161           <xsl:if test="contains($list-stat-norm,
    162                                  concat(' ',ancestor::sect1/@id,' '))">
     163          <xsl:if test="$want-stats">
    163164            <xsl:call-template name="output-destdir"/>
    164165          </xsl:if>
     
    167168        </xsl:if>
    168169        <xsl:if test="$prec-nature='config'">
    169           <xsl:if test="contains($list-stat-norm,
    170                                  concat(' ',ancestor::sect1/@id,' '))">
     170          <xsl:if test="$want-stats">
    171171            <xsl:call-template name="end-root"/>
    172172            <xsl:call-template name="output-destdir"/>
     
    176176        </xsl:if>
    177177        <xsl:apply-templates mode="install"/>
    178         <xsl:text>
    179 </xsl:text>
    180178        <xsl:if test="$follow-nature='none'">
    181179          <xsl:call-template name="end-install"/>
     
    189187  <xsl:template name="begin-root">
    190188    <xsl:if test="$sudo='y'">
    191       <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF
    192 </xsl:text>
     189      <xsl:text>
     190sudo -E sh &lt;&lt; ROOT_EOF</xsl:text>
    193191    </xsl:if>
    194192  </xsl:template>
     
    196194  <xsl:template name="begin-install">
    197195    <xsl:if test="$wrap-install = 'y'">
    198       <xsl:text>if [ -r "$JH_PACK_INSTALL" ]; then
     196      <xsl:text>
     197if [ -r "$JH_PACK_INSTALL" ]; then
    199198  source $JH_PACK_INSTALL
    200199  export -f wrapInstall
    201200  export -f packInstall
    202201fi
    203 wrapInstall '
    204 </xsl:text>
     202wrapInstall '</xsl:text>
    205203    </xsl:if>
    206204  </xsl:template>
     
    208206  <xsl:template name="end-root">
    209207    <xsl:if test="$sudo='y'">
    210       <xsl:text>ROOT_EOF
    211 </xsl:text>
     208      <xsl:text>
     209ROOT_EOF</xsl:text>
    212210    </xsl:if>
    213211  </xsl:template>
     
    220218    </xsl:if>
    221219    <xsl:if test="$wrap-install = 'y'">
    222       <xsl:text>'&#xA;packInstall&#xA;</xsl:text>
    223     </xsl:if>
    224   </xsl:template>
    225 
    226   <xsl:template match="text()" mode="install">
     220      <xsl:text>'&#xA;packInstall</xsl:text>
     221    </xsl:if>
     222  </xsl:template>
     223
     224  <xsl:template match="userinput" mode="install">
     225    <xsl:text>
     226</xsl:text>
    227227    <xsl:call-template name="output-install">
    228       <xsl:with-param name="out-string" select="."/>
     228      <xsl:with-param name="out-string" select="string()"/>
    229229    </xsl:call-template>
    230230  </xsl:template>
     
    233233    <xsl:param name="out-string" select="''"/>
    234234    <xsl:choose>
     235      <xsl:when test="starts-with($out-string, 'make ') or
     236                      contains($out-string,' make ') or
     237                      contains($out-string,'&#xA;make')">
     238        <xsl:call-template name="output-install">
     239          <xsl:with-param
     240               name="out-string"
     241               select="substring-before($out-string,'make ')"/>
     242        </xsl:call-template>
     243        <xsl:text>make -j1 </xsl:text>
     244        <xsl:call-template name="output-install">
     245          <xsl:with-param
     246               name="out-string"
     247               select="substring-after($out-string,'make ')"/>
     248        </xsl:call-template>
     249      </xsl:when>
    235250      <xsl:when test="contains($out-string,string($APOS))
    236251                      and $wrap-install = 'y'">
Note: See TracChangeset for help on using the changeset viewer.