Ignore:
Timestamp:
08/13/2019 03:28:49 PM (5 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
c992876
Parents:
7933ed7
Message:

BLFS/xsl: refactor the generation of installation instructions, owing to
the new remap="test/doc" attributes

File:
1 edited

Legend:

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

    r7933ed7 r8fc6a47  
    1414    <xsl:param name="doc-seen"/>
    1515
    16 <!-- "nature" variables:
    17       - 'non-root': executable as user
    18       - 'config': execute as root, with no special formatting
    19       - 'install': execute as root, with PKG_DEST or escape instructions
    20       - 'none': does not exist (for preceding of following uniquely)
    21 -->
    22     <xsl:variable name="my-nature">
    23       <xsl:choose>
    24         <xsl:when test="not(@role)">
    25           <xsl:text>non-root</xsl:text>
    26         </xsl:when>
    27         <xsl:when test="contains(string(),'useradd') or
    28                         contains(string(),'groupadd') or
    29                         contains(string(),'usermod') or
    30                         contains(string(),'icon-cache') or
    31                         contains(string(),'desktop-database') or
    32                         contains(string(),'compile-schemas') or
    33                         contains(string(),'query-loaders') or
    34                         contains(string(),'pam.d') or
    35                         contains(string(),'query-immodules')">
    36           <xsl:text>config</xsl:text>
    37         </xsl:when>
    38         <xsl:otherwise>
    39           <xsl:text>install</xsl:text>
    40         </xsl:otherwise>
    41       </xsl:choose>
    42     </xsl:variable>
    43 
    44     <xsl:variable
    45          name="prec-screen"
    46          select="preceding::screen[not(@role='nodump') and ./userinput][1]
    47                         [ancestor::sect2 = current()/ancestor::sect2]"/>
    48 
    49     <xsl:variable
    50          name="prec-string"
    51          select="string($prec-screen)"/>
    52 
    53 <!--
    54     <xsl:message>
    55       <xsl:text>
    56 ==============================
    57 List of preceding siblings for "</xsl:text>
    58       <xsl:value-of select="./userinput"/>
    59       <xsl:text>":
    60 </xsl:text>
    61       <xsl:for-each select="preceding-sibling::screen[not(@role='nodump') and
    62                                                       ./userinput] |
    63                    preceding-sibling::para/command">
    64         <xsl:copy-of select=".//text()"/>
     16<!-- Isolate the current instruction -->
     17    <xsl:variable name="current-instr" select="$instruction-tree[1]"/>
     18
     19    <xsl:choose>
     20<!-- First, if we have an empty tree, close everything and exit -->
     21      <xsl:when test="not($current-instr)">
     22        <xsl:if test="$install-seen">
     23          <xsl:call-template name="end-install"/>
     24        </xsl:if>
     25        <xsl:if test="$root-seen">
     26          <xsl:call-template name="end-root"/>
     27        </xsl:if>
     28        <xsl:if test="$doc-seen and not($root-seen)">
     29          <xsl:call-template name="end-doc">
     30            <xsl:with-param name="want-stats" select="$want-stats"/>
     31          </xsl:call-template>
     32        </xsl:if>
     33        <xsl:if test="$test-seen">
     34          <xsl:call-template name="end-test">
     35            <xsl:with-param name="want-stats" select="$want-stats"/>
     36          </xsl:call-template>
     37        </xsl:if>
     38      </xsl:when><!-- empty tree -->
     39      <xsl:when test="$current-instr[@role='root' and @remap='test']">
     40        <xsl:if test="$install-seen">
     41          <xsl:call-template name="end-install"/>
     42        </xsl:if>
     43        <xsl:if test="$root-seen">
     44          <xsl:call-template name="end-root"/>
     45        </xsl:if>
     46        <xsl:if test="$doc-seen and not($root-seen)">
     47          <xsl:call-template name="end-doc">
     48            <xsl:with-param name="want-stats" select="$want-stats"/>
     49          </xsl:call-template>
     50        </xsl:if>
     51        <xsl:if test="not($test-seen)">
     52          <xsl:call-template name="begin-test">
     53            <xsl:with-param name="want-stats" select="$want-stats"/>
     54          </xsl:call-template>
     55        </xsl:if>
     56        <xsl:call-template name="begin-root"/>
     57        <xsl:choose>
     58          <xsl:when test="$want-stats">
     59            <xsl:apply-templates select="$current-instr" mode="root"/>
     60          </xsl:when>
     61          <xsl:otherwise>
     62            <xsl:apply-templates select="$current-instr"
     63                                 mode="root-comment-out"/>
     64          </xsl:otherwise>
     65        </xsl:choose>
     66        <xsl:call-template name="process-install">
     67          <xsl:with-param
     68             name="instruction-tree"
     69             select="$instruction-tree[position()>1]"/>
     70          <xsl:with-param name="want-stats" select="$want-stats"/>
     71          <xsl:with-param name="root-seen" select="boolean(1)"/>
     72          <xsl:with-param name="install-seen" select="boolean(0)"/>
     73          <xsl:with-param name="test-seen" select="boolean(1)"/>
     74          <xsl:with-param name="doc-seen" select="boolean(0)"/>
     75        </xsl:call-template>
     76      </xsl:when><!-- role="root" and remap="test" -->
     77      <xsl:when test="$current-instr[@role='root' and @remap='doc']">
     78        <xsl:if test="$test-seen">
     79          <xsl:call-template name="end-test">
     80            <xsl:with-param name="want-stats" select="$want-stats"/>
     81          </xsl:call-template>
     82        </xsl:if>
     83        <xsl:if test="$doc-seen and not($root-seen)">
     84          <xsl:call-template name="end-doc">
     85            <xsl:with-param name="want-stats" select="$want-stats"/>
     86          </xsl:call-template>
     87        </xsl:if>
     88        <xsl:if test="not($root-seen)">
     89          <xsl:call-template name="begin-root"/>
     90        </xsl:if>
     91        <xsl:if test="not($install-seen)">
     92          <xsl:call-template name="begin-install"/>
     93        </xsl:if>
     94        <xsl:apply-templates select="$current-instr"
     95                             mode="install-comment-out"/>
     96<!-- The above template ends with a commented line, so that if end-install
     97     adds a closing single quote, it will not be seen. Add a CR to prevent
     98     that -->
    6599        <xsl:text>
    66 ===
    67 </xsl:text>
    68       </xsl:for-each>
    69     </xsl:message>
    70 -->
    71     <xsl:variable name="prec-nature">
    72       <xsl:choose>
    73         <xsl:when
    74              test="$prec-string='' or
    75                    (preceding::screen[not(@role='nodump') and
    76                                                  ./userinput] |
    77                     preceding::command[contains(text(),'check') or
    78                                        contains(text(),'test')]
    79                    )[last()][self::command]">
    80           <xsl:text>none</xsl:text>
    81         </xsl:when>
    82         <xsl:when test="$prec-screen[not(@role)]">
    83           <xsl:text>non-root</xsl:text>
    84         </xsl:when>
    85         <xsl:when test="contains($prec-string,'useradd') or
    86                         contains($prec-string,'groupadd') or
    87                         contains($prec-string,'usermod') or
    88                         contains($prec-string,'icon-cache') or
    89                         contains($prec-string,'desktop-database') or
    90                         contains($prec-string,'compile-schemas') or
    91                         contains($prec-string,'query-loaders') or
    92                         contains($prec-string,'pam.d') or
    93                         contains($prec-string,'query-immodules')">
    94           <xsl:text>config</xsl:text>
    95         </xsl:when>
    96         <xsl:otherwise>
    97           <xsl:text>install</xsl:text>
    98         </xsl:otherwise>
    99       </xsl:choose>
    100     </xsl:variable>
    101 
    102     <xsl:variable
    103          name="follow-screen"
    104          select="following::screen[not(@role='nodump') and ./userinput][1]
    105                         [ancestor::sect2 = current()/ancestor::sect2]"/>
    106 
    107     <xsl:variable
    108          name="follow-string"
    109          select="string($follow-screen)"/>
    110 
    111     <xsl:variable name="follow-nature">
    112       <xsl:choose>
    113         <xsl:when
    114              test="$follow-string='' or
    115                    (following::screen[not(@role='nodump') and
    116                                                  ./userinput] |
    117                     following::command[contains(text(),'check') or
    118                                        contains(text(),'test')]
    119                    )[1][self::command]">
    120           <xsl:text>none</xsl:text>
    121         </xsl:when>
    122         <xsl:when test="$follow-screen[not(@role)]">
    123           <xsl:text>non-root</xsl:text>
    124         </xsl:when>
    125         <xsl:when test="contains($follow-string,'useradd') or
    126                         contains($follow-string,'groupadd') or
    127                         contains($follow-string,'usermod') or
    128                         contains($follow-string,'icon-cache') or
    129                         contains($follow-string,'desktop-database') or
    130                         contains($follow-string,'compile-schemas') or
    131                         contains($follow-string,'query-loaders') or
    132                         contains($follow-string,'pam.d') or
    133                         contains($follow-string,'query-immodules')">
    134           <xsl:text>config</xsl:text>
    135         </xsl:when>
    136         <xsl:otherwise>
    137           <xsl:text>install</xsl:text>
    138         </xsl:otherwise>
    139       </xsl:choose>
    140     </xsl:variable>
    141 
     100</xsl:text>
     101        <xsl:call-template name="process-install">
     102          <xsl:with-param
     103             name="instruction-tree"
     104             select="$instruction-tree[position()>1]"/>
     105          <xsl:with-param name="want-stats" select="$want-stats"/>
     106          <xsl:with-param name="root-seen" select="boolean(1)"/>
     107          <xsl:with-param name="install-seen" select="boolean(1)"/>
     108          <xsl:with-param name="test-seen" select="boolean(0)"/>
     109          <xsl:with-param name="doc-seen" select="boolean(1)"/>
     110        </xsl:call-template>
     111      </xsl:when><!--role="root" and remap="doc" -->
     112      <xsl:when test="$current-instr[@role='root']">
     113        <xsl:choose>
     114          <xsl:when test="contains(string($current-instr),'useradd') or
     115                          contains(string($current-instr),'groupadd') or
     116                          contains(string($current-instr),'usermod') or
     117                          contains(string($current-instr),'icon-cache') or
     118                          contains(string($current-instr),'desktop-database') or
     119                          contains(string($current-instr),'compile-schemas') or
     120                          contains(string($current-instr),'query-loaders') or
     121                          contains(string($current-instr),'pam.d') or
     122                          contains(string($current-instr),'query-immodules')">
     123            <xsl:if test="$install-seen">
     124              <xsl:call-template name="end-install"/>
     125            </xsl:if>
     126            <xsl:if test="$test-seen">
     127              <xsl:call-template name="end-test">
     128                <xsl:with-param name="want-stats" select="$want-stats"/>
     129              </xsl:call-template>
     130            </xsl:if>
     131            <xsl:if test="$doc-seen and not($root-seen)">
     132              <xsl:call-template name="end-doc">
     133                <xsl:with-param name="want-stats" select="$want-stats"/>
     134              </xsl:call-template>
     135            </xsl:if>
     136            <xsl:if test="not($root-seen)">
     137              <xsl:call-template name="begin-root"/>
     138            </xsl:if>
     139            <xsl:apply-templates select="$current-instr" mode="root"/>
     140            <xsl:call-template name="process-install">
     141              <xsl:with-param
     142                 name="instruction-tree"
     143                 select="$instruction-tree[position()>1]"/>
     144              <xsl:with-param name="want-stats" select="$want-stats"/>
     145              <xsl:with-param name="root-seen" select="boolean(1)"/>
     146              <xsl:with-param name="install-seen" select="boolean(0)"/>
     147              <xsl:with-param name="test-seen" select="boolean(0)"/>
     148              <xsl:with-param name="doc-seen" select="boolean(0)"/>
     149            </xsl:call-template>
     150          </xsl:when><!-- end config as root -->
     151          <xsl:otherwise><!-- we have a true install instruction -->
     152            <xsl:if test="$test-seen">
     153              <xsl:call-template name="end-test">
     154                <xsl:with-param name="want-stats" select="$want-stats"/>
     155              </xsl:call-template>
     156            </xsl:if>
     157            <xsl:if test="$doc-seen and not($root-seen)">
     158              <xsl:call-template name="end-doc">
     159                <xsl:with-param name="want-stats" select="$want-stats"/>
     160              </xsl:call-template>
     161            </xsl:if>
     162            <xsl:if test="$want-stats and not($install-seen)">
     163              <xsl:if test="$root-seen">
     164                <xsl:call-template name="end-root"/>
     165              </xsl:if>
     166              <xsl:text>
     167echo Time before install: ${SECONDS} >> $INFOLOG</xsl:text>
     168              <xsl:apply-templates
     169                         select="$instruction-tree[@role='root']/userinput"
     170                         mode="destdir"/>
     171              <xsl:text>
     172
     173echo Time after install: ${SECONDS} >> $INFOLOG
     174echo Size after install: $(sudo du -skx --exclude home /) >> $INFOLOG
     175</xsl:text>
     176              <xsl:if test="$root-seen">
     177                <xsl:call-template name="begin-root"/>
     178              </xsl:if>
     179            </xsl:if>
     180            <xsl:if test="not($root-seen)">
     181              <xsl:call-template name="begin-root"/>
     182            </xsl:if>
     183            <xsl:if test="not($install-seen)">
     184              <xsl:call-template name="begin-install"/>
     185            </xsl:if>
     186            <xsl:apply-templates select="$current-instr" mode="install"/>
     187            <xsl:call-template name="process-install">
     188              <xsl:with-param
     189                 name="instruction-tree"
     190                 select="$instruction-tree[position()>1]"/>
     191              <xsl:with-param name="want-stats" select="$want-stats"/>
     192              <xsl:with-param name="root-seen" select="boolean(1)"/>
     193              <xsl:with-param name="install-seen" select="boolean(1)"/>
     194              <xsl:with-param name="test-seen" select="boolean(0)"/>
     195              <xsl:with-param name="doc-seen" select="boolean(0)"/>
     196            </xsl:call-template>
     197          </xsl:otherwise><!-- end true install instruction -->
     198        </xsl:choose>
     199      </xsl:when><!-- role="root" and no remap -->
     200      <xsl:when test="$current-instr[@remap='test'] or
     201                      $current-instr/self::command">
     202        <xsl:if test="$install-seen">
     203          <xsl:call-template name="end-install"/>
     204        </xsl:if>
     205        <xsl:if test="$root-seen">
     206          <xsl:call-template name="end-root"/>
     207        </xsl:if>
     208        <xsl:if test="$doc-seen and not($root-seen)">
     209          <xsl:call-template name="end-doc">
     210            <xsl:with-param name="want-stats" select="$want-stats"/>
     211          </xsl:call-template>
     212        </xsl:if>
     213        <xsl:if test="not($test-seen)">
     214          <xsl:if test="not($doc-seen)">
     215            <xsl:call-template name="end-make">
     216              <xsl:with-param name="want-stats" select="$want-stats"/>
     217            </xsl:call-template>
     218          </xsl:if>
     219          <xsl:call-template name="begin-test">
     220            <xsl:with-param name="want-stats" select="$want-stats"/>
     221          </xsl:call-template>
     222        </xsl:if>
     223        <xsl:choose>
     224          <xsl:when test="$want-stats">
     225            <xsl:apply-templates select="$current-instr"/>
     226          </xsl:when>
     227          <xsl:otherwise>
     228            <xsl:apply-templates select="$current-instr" mode="comment-out"/>
     229          </xsl:otherwise>
     230        </xsl:choose>
     231        <xsl:call-template name="process-install">
     232          <xsl:with-param
     233             name="instruction-tree"
     234             select="$instruction-tree[position()>1]"/>
     235          <xsl:with-param name="want-stats" select="$want-stats"/>
     236          <xsl:with-param name="root-seen" select="boolean(0)"/>
     237          <xsl:with-param name="install-seen" select="boolean(0)"/>
     238          <xsl:with-param name="test-seen" select="boolean(1)"/>
     239          <xsl:with-param name="doc-seen" select="boolean(0)"/>
     240        </xsl:call-template>
     241      </xsl:when><!-- no role, remap=test -->
     242      <xsl:when test="$current-instr[@remap='doc']">
     243        <xsl:if test="$install-seen">
     244          <xsl:call-template name="end-install"/>
     245        </xsl:if>
     246        <xsl:if test="$root-seen">
     247          <xsl:call-template name="end-root"/>
     248        </xsl:if>
     249        <xsl:if test="$test-seen">
     250          <xsl:call-template name="end-test">
     251            <xsl:with-param name="want-stats" select="$want-stats"/>
     252          </xsl:call-template>
     253        </xsl:if>
     254        <xsl:if test="not($doc-seen) or $root-seen">
     255          <xsl:if test="not($test-seen) and not($root-seen)">
     256            <xsl:call-template name="end-make">
     257              <xsl:with-param name="want-stats" select="$want-stats"/>
     258            </xsl:call-template>
     259          </xsl:if>
     260          <xsl:call-template name="begin-doc">
     261            <xsl:with-param name="want-stats" select="$want-stats"/>
     262          </xsl:call-template>
     263        </xsl:if>
     264        <xsl:choose>
     265          <xsl:when test="$want-stats">
     266            <xsl:apply-templates select="$current-instr"/>
     267          </xsl:when>
     268          <xsl:otherwise>
     269            <xsl:apply-templates select="$current-instr" mode="comment-out"/>
     270          </xsl:otherwise>
     271        </xsl:choose>
     272        <xsl:call-template name="process-install">
     273          <xsl:with-param
     274             name="instruction-tree"
     275             select="$instruction-tree[position()>1]"/>
     276          <xsl:with-param name="want-stats" select="$want-stats"/>
     277          <xsl:with-param name="root-seen" select="boolean(0)"/>
     278          <xsl:with-param name="install-seen" select="boolean(0)"/>
     279          <xsl:with-param name="test-seen" select="boolean(0)"/>
     280          <xsl:with-param name="doc-seen" select="boolean(1)"/>
     281        </xsl:call-template>
     282      </xsl:when><!-- no role, remap="doc" -->
     283      <xsl:otherwise><!-- no role no remap -->
     284        <xsl:if test="$install-seen">
     285          <xsl:call-template name="end-install"/>
     286        </xsl:if>
     287        <xsl:if test="$root-seen">
     288          <xsl:call-template name="end-root"/>
     289        </xsl:if>
     290        <xsl:if test="$doc-seen and not($root-seen)">
     291          <xsl:call-template name="end-doc">
     292            <xsl:with-param name="want-stats" select="$want-stats"/>
     293          </xsl:call-template>
     294        </xsl:if>
     295        <xsl:if test="$test-seen">
     296          <xsl:call-template name="end-test">
     297            <xsl:with-param name="want-stats" select="$want-stats"/>
     298          </xsl:call-template>
     299        </xsl:if>
     300        <xsl:apply-templates select="$current-instr"/>
     301        <xsl:call-template name="process-install">
     302          <xsl:with-param
     303             name="instruction-tree"
     304             select="$instruction-tree[position()>1]"/>
     305          <xsl:with-param name="want-stats" select="$want-stats"/>
     306          <xsl:with-param name="root-seen" select="boolean(0)"/>
     307          <xsl:with-param name="install-seen" select="boolean(0)"/>
     308          <xsl:with-param name="test-seen" select="boolean(0)"/>
     309          <xsl:with-param name="doc-seen" select="boolean(0)"/>
     310        </xsl:call-template>
     311      </xsl:otherwise><!-- no role, no remap -->
     312    </xsl:choose>
     313  </xsl:template>
     314
     315  <xsl:template match="userinput" mode="install-comment-out">
     316    <xsl:text>
     317</xsl:text>
     318    <xsl:call-template name="output-comment-out">
     319      <xsl:with-param name="out-string" select="string()"/>
     320      <xsl:with-param name="process" select="'install'"/>
     321    </xsl:call-template>
     322  </xsl:template>
     323
     324  <xsl:template match="userinput|command" mode="root-comment-out">
     325    <xsl:text>
     326</xsl:text>
     327    <xsl:call-template name="output-comment-out">
     328      <xsl:with-param name="out-string" select="string()"/>
     329      <xsl:with-param name="process" select="'root'"/>
     330    </xsl:call-template>
     331  </xsl:template>
     332
     333  <xsl:template match="userinput|command" mode="comment-out">
     334    <xsl:text>
     335</xsl:text>
     336    <xsl:call-template name="output-comment-out">
     337      <xsl:with-param name="out-string" select="string()"/>
     338      <xsl:with-param name="process" select="'none'"/>
     339    </xsl:call-template>
     340  </xsl:template>
     341
     342  <xsl:template match="userinput" mode="install">
     343    <xsl:text>
     344</xsl:text>
     345    <xsl:call-template name="output-install">
     346      <xsl:with-param name="out-string" select="string()"/>
     347    </xsl:call-template>
     348  </xsl:template>
     349
     350  <xsl:template name="output-comment-out">
     351<!-- Output instructions with each line commented out. The "process"
     352     parameter is:
     353        none: only output commented-out and remove ampersand
     354        root: output commented out and remove ampersand,
     355              with escaping of \, $, and `
     356        install: same + escape ' -->
     357    <xsl:param name="out-string"/>
     358    <xsl:param name="process"/>
    142359    <xsl:choose>
    143       <xsl:when test="$my-nature='non-root'">
    144         <xsl:if test="$prec-nature='install'">
    145           <xsl:call-template name="end-install"/>
    146           <xsl:call-template name="end-root"/>
    147         </xsl:if>
    148         <xsl:if test="$prec-nature='config'">
    149           <xsl:call-template name="end-root"/>
    150         </xsl:if>
    151         <xsl:apply-templates/>
     360      <xsl:when test="contains($out-string,'&#xA;')">
     361        <xsl:choose>
     362          <xsl:when test="$process='install'">
     363            <xsl:call-template name="output-install">
     364              <xsl:with-param
     365                        name="out-string"
     366                        select="concat('# ',
     367                                        substring-before($out-string,'&#xA;')
     368                                      )"/>
     369            </xsl:call-template>
     370          </xsl:when>
     371          <xsl:when test="$process='root'">
     372            <xsl:call-template name="output-root">
     373              <xsl:with-param
     374                        name="out-string"
     375                        select="concat('# ',
     376                                        substring-before($out-string,'&#xA;')
     377                                      )"/>
     378            </xsl:call-template>
     379          </xsl:when>
     380          <xsl:otherwise>
     381            <xsl:call-template name="remove-ampersand">
     382              <xsl:with-param
     383                        name="out-string"
     384                        select="concat('# ',
     385                                        substring-before($out-string,'&#xA;')
     386                                      )"/>
     387            </xsl:call-template>
     388          </xsl:otherwise>
     389        </xsl:choose>
     390        <xsl:text>
     391</xsl:text>
     392        <xsl:call-template name="output-comment-out">
     393          <xsl:with-param
     394                    name="out-string"
     395                    select="substring-after($out-string,'&#xA;')"/>
     396          <xsl:with-param name="process" select="$process"/>
     397        </xsl:call-template>
    152398      </xsl:when>
    153 
    154       <xsl:when test="$my-nature='config'">
    155         <xsl:if test="$prec-nature='none' or $prec-nature='non-root'">
    156           <xsl:call-template name="begin-root"/>
    157         </xsl:if>
    158         <xsl:if test="$prec-nature='install'">
    159           <xsl:call-template name="end-install"/>
    160         </xsl:if>
    161         <xsl:apply-templates mode="root"/>
    162         <xsl:if test="$follow-nature='none'">
    163           <xsl:call-template name="end-root"/>
    164         </xsl:if>
    165       </xsl:when>
    166 
    167       <xsl:when test="$my-nature='install'">
    168         <xsl:if test="$prec-nature='none' or $prec-nature='non-root'">
    169           <xsl:if test="$want-stats">
    170             <xsl:call-template name="output-destdir"/>
    171           </xsl:if>
    172           <xsl:call-template name="begin-root"/>
    173           <xsl:call-template name="begin-install"/>
    174         </xsl:if>
    175         <xsl:if test="$prec-nature='config'">
    176           <xsl:if test="$want-stats">
    177             <xsl:call-template name="end-root"/>
    178             <xsl:call-template name="output-destdir"/>
    179             <xsl:call-template name="begin-root"/>
    180           </xsl:if>
    181           <xsl:call-template name="begin-install"/>
    182         </xsl:if>
    183         <xsl:apply-templates mode="install"/>
    184         <xsl:if test="$follow-nature='none'">
    185           <xsl:call-template name="end-install"/>
    186           <xsl:call-template name="end-root"/>
    187         </xsl:if>
    188       </xsl:when>
    189 
     399      <xsl:otherwise>
     400        <xsl:choose>
     401          <xsl:when test="$process='install'">
     402            <xsl:call-template name="output-install">
     403              <xsl:with-param name="out-string"
     404                              select="concat('# ',$out-string)"/>
     405            </xsl:call-template>
     406          </xsl:when>
     407          <xsl:when test="$process='root'">
     408            <xsl:call-template name="output-root">
     409              <xsl:with-param name="out-string"
     410                              select="concat('# ',$out-string)"/>
     411            </xsl:call-template>
     412          </xsl:when>
     413          <xsl:otherwise>
     414            <xsl:call-template name="remove-ampersand">
     415              <xsl:with-param name="out-string"
     416                              select="concat('# ',$out-string)"/>
     417            </xsl:call-template>
     418          </xsl:otherwise>
     419        </xsl:choose>
     420      </xsl:otherwise>
    190421    </xsl:choose>
     422  </xsl:template>
     423
     424  <xsl:template name="end-make">
     425    <xsl:param name="want-stats"/>
     426    <xsl:if test="$want-stats">
     427      <xsl:text>
     428
     429echo Time after make: ${SECONDS} >> $INFOLOG
     430echo Size after make: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
     431    </xsl:if>
     432  </xsl:template>
     433
     434  <xsl:template name="begin-doc">
     435    <xsl:param name="want-stats"/>
     436    <xsl:if test="$want-stats">
     437      <xsl:text>
     438echo Time before doc: ${SECONDS} >> $INFOLOG
     439</xsl:text>
     440    </xsl:if>
     441  </xsl:template>
     442
     443  <xsl:template name="begin-test">
     444    <xsl:param name="want-stats"/>
     445    <xsl:if test="$want-stats">
     446      <xsl:text>
     447echo Time before test: ${SECONDS} >> $INFOLOG
     448</xsl:text>
     449    </xsl:if>
    191450  </xsl:template>
    192451
     
    210469  </xsl:template>
    211470
     471  <xsl:template name="end-doc">
     472    <xsl:param name="want-stats"/>
     473    <xsl:if test="$want-stats">
     474      <xsl:text>
     475
     476echo Time after doc: ${SECONDS} >> $INFOLOG
     477echo Size after doc: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
     478    </xsl:if>
     479  </xsl:template>
     480
     481  <xsl:template name="end-test">
     482    <xsl:param name="want-stats"/>
     483    <xsl:if test="$want-stats">
     484      <xsl:text>
     485
     486echo Time after test: ${SECONDS} >> $INFOLOG
     487echo Size after test: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
     488    </xsl:if>
     489  </xsl:template>
     490
    212491  <xsl:template name="end-root">
    213492    <xsl:if test="$sudo='y'">
     
    226505      <xsl:text>'&#xA;packInstall</xsl:text>
    227506    </xsl:if>
    228   </xsl:template>
    229 
    230   <xsl:template match="userinput" mode="install">
    231     <xsl:text>
    232 </xsl:text>
    233     <xsl:call-template name="output-install">
    234       <xsl:with-param name="out-string" select="string()"/>
    235     </xsl:call-template>
    236507  </xsl:template>
    237508
Note: See TracChangeset for help on using the changeset viewer.