Changeset fa1b640 for LFS/lfs.xsl


Ignore:
Timestamp:
09/22/2007 11:33:56 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
4ddaa8e
Parents:
e213e4c
Message:

Moved remaining build hacks to named templates.
Added a lot of hocks for userinput customizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LFS/lfs.xsl

    re213e4c rfa1b640  
    141141      <!-- Exit -->
    142142    <xsl:text>&#xA;exit&#xA;</xsl:text>
     143  </xsl:template>
     144
     145
     146    <!-- Extra commads needed at the start of some screen block
     147         to allow automatization -->
     148  <xsl:template name="top_screen_build_fixes">
     149      <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
     150    <xsl:if test="contains(string(),'firmware,udev')">
     151      <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
     152    </xsl:if>
     153  </xsl:template>
     154
     155
     156    <!-- Extra commads needed at the end of some screen block
     157         to allow automatization -->
     158  <xsl:template name="bottom_screen_build_fixes">
     159      <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
     160    <xsl:if test="contains(string(),'firmware,udev')">
     161      <xsl:text>&#xA;fi</xsl:text>
     162    </xsl:if>
     163      <!-- Copying the kernel config file -->
     164    <xsl:if test="string() = 'make mrproper'">
     165      <xsl:text>&#xA;cp -v ../kernel-config .config</xsl:text>
     166    </xsl:if>
     167      <!-- Don't stop on strip run -->
     168    <xsl:if test="contains(string(),'strip --strip')">
     169      <xsl:text> || true</xsl:text>
     170    </xsl:if>
    143171  </xsl:template>
    144172
     
    306334  <xsl:template match="screen">
    307335    <xsl:if test="child::* = userinput and not(@role = 'nodump')">
    308       <xsl:apply-templates select="userinput"/>
    309     </xsl:if>
    310   </xsl:template>
    311 
    312 
    313     <!-- userinput -->
     336      <xsl:call-template name="top_screen_build_fixes"/>
     337      <xsl:apply-templates/>
     338      <xsl:call-template name="bottom_screen_build_fixes"/>
     339      <xsl:text>&#xA;</xsl:text>
     340    </xsl:if>
     341  </xsl:template>
     342
     343
     344    <!-- userinput @remap='pre' -->
     345  <xsl:template match="userinput[@remap='pre']">
     346    <xsl:apply-templates select="." mode="pre"/>
     347  </xsl:template>
     348
     349
     350    <!-- userinput @remap='configure' -->
     351  <xsl:template match="userinput[@remap='configure']">
     352    <xsl:apply-templates select="." mode="configure"/>
     353  </xsl:template>
     354
     355
     356    <!-- userinput @remap='make' -->
     357  <xsl:template match="userinput[@remap='make']">
     358    <xsl:apply-templates select="." mode="make"/>
     359  </xsl:template>
     360
     361
     362    <!-- userinput @remap='test' -->
     363  <xsl:template match="userinput[@remap='test']">
     364    <xsl:apply-templates select="." mode="test"/>
     365  </xsl:template>
     366
     367
     368    <!-- userinput @remap='install' -->
     369  <xsl:template match="userinput[@remap='install']">
     370    <xsl:apply-templates select="." mode="install"/>
     371  </xsl:template>
     372
     373
     374    <!-- userinput @remap='adjust' -->
     375  <xsl:template match="userinput[@remap='adjust']">
     376    <xsl:apply-templates select="." mode="adjust"/>
     377  </xsl:template>
     378
     379
     380    <!-- userinput @remap='locale-test' -->
     381  <xsl:template match="userinput[@remap='locale-test']">
     382    <xsl:apply-templates select="." mode="locale-test"/>
     383  </xsl:template>
     384
     385
     386    <!-- userinput @remap='locale-full' -->
     387  <xsl:template match="userinput[@remap='locale-full']">
     388    <xsl:apply-templates select="." mode="locale-full"/>
     389  </xsl:template>
     390
     391
     392
     393    <!-- userinput without @remap -->
    314394  <xsl:template match="userinput">
    315395    <xsl:choose>
    316       <xsl:when test="@remap = 'pre'">
    317         <xsl:apply-templates select="." mode="pre"/>
    318       </xsl:when>
    319       <xsl:when test="@remap = 'configure'">
    320         <xsl:apply-templates select="." mode="configure"/>
    321       </xsl:when>
    322       <xsl:when test="@remap = 'make'">
    323         <xsl:apply-templates select="." mode="make"/>
    324       </xsl:when>
    325       <xsl:when test="@remap = 'test'">
    326         <xsl:apply-templates select="." mode="test"/>
    327       </xsl:when>
    328       <xsl:when test="@remap = 'install'">
    329         <xsl:apply-templates select="." mode="install"/>
    330       </xsl:when>
    331       <xsl:when test="@remap = 'adjust'">
    332         <xsl:apply-templates select="." mode="adjust"/>
    333       </xsl:when>
    334       <xsl:when test="@remap = 'locale-test'">
    335         <xsl:apply-templates select="." mode="locale-test"/>
    336       </xsl:when>
    337       <xsl:when test="@remap = 'locale-full'">
    338         <xsl:apply-templates select="." mode="locale-full"/>
     396      <xsl:when test="ancestor::sect2[@role='configuration']">
     397        <xsl:apply-templates select="." mode="configuration_section"/>
    339398      </xsl:when>
    340399      <xsl:otherwise>
    341         <xsl:apply-templates select="." mode="default"/>
     400        <xsl:apply-templates select="." mode="no_remap"/>
    342401      </xsl:otherwise>
    343402    </xsl:choose>
    344     <xsl:text>&#xA;</xsl:text>
    345403  </xsl:template>
    346404
     
    374432<!-- ############################# MODE TEMPLATES ########################### -->
    375433
    376     <!-- mode default  -->
    377   <xsl:template match="userinput" mode="default">
    378       <!-- All ugly hacks required to fix automatization build issues,
    379            except the ones related to testsuites, should go here,
    380            no matter what @remap value have assigned -->
    381     <xsl:choose>
    382         <!-- Fix Udev reinstallation after a build failure -->
    383       <xsl:when test="contains(string(),'firmware,udev')">
    384         <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
    385         <xsl:apply-templates/>
    386         <xsl:text>&#xA;fi</xsl:text>
    387       </xsl:when>
    388         <!-- Copying the kernel config file -->
    389       <xsl:when test="string() = 'make mrproper'">
    390         <xsl:text>make mrproper&#xA;</xsl:text>
    391         <xsl:text>cp -v ../kernel-config .config</xsl:text>
    392       </xsl:when>
    393         <!-- Don't stop on strip run -->
    394       <xsl:when test="contains(string(),'strip --strip')">
    395         <xsl:apply-templates/>
    396         <xsl:text> || true</xsl:text>
    397       </xsl:when>
    398         <!-- The rest of commands -->
    399       <xsl:otherwise>
    400         <xsl:apply-templates/>
    401       </xsl:otherwise>
    402     </xsl:choose>
    403   </xsl:template>
    404 
    405434
    406435    <!-- mode test  -->
     
    517546  </xsl:template>
    518547
     548
     549    <!-- mode configuration_section  -->
     550  <xsl:template match="userinput" mode="configuration_section">
     551    <xsl:apply-templates select="." mode="default"/>
     552  </xsl:template>
     553
     554
     555    <!-- mode no_remap  -->
     556  <xsl:template match="userinput" mode="no_remap">
     557    <xsl:apply-templates select="." mode="default"/>
     558  </xsl:template>
     559
     560
     561    <!-- mode default  -->
     562  <xsl:template match="userinput" mode="default">
     563    <xsl:apply-templates/>
     564  </xsl:template>
     565
    519566</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.