[0170229] | 1 | <?xml version="1.0"?>
|
---|
| 2 |
|
---|
[3a5c9cc] | 3 | <!-- $Id$ -->
|
---|
| 4 |
|
---|
[0170229] | 5 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 6 | xmlns:exsl="http://exslt.org/common"
|
---|
| 7 | extension-element-prefixes="exsl"
|
---|
| 8 | version="1.0">
|
---|
| 9 |
|
---|
| 10 | <!-- XSLT stylesheet to create shell scripts from LFS books. -->
|
---|
| 11 |
|
---|
[3778352] | 12 | <!-- ####################### PARAMETERS ################################### -->
|
---|
| 13 |
|
---|
[6db1464] | 14 | <!-- Run test suites?
|
---|
| 15 | 0 = none
|
---|
| 16 | 1 = only chapter06 Glibc, GCC and Binutils testsuites
|
---|
| 17 | 2 = all chapter06 testsuites
|
---|
[056486c] | 18 | 3 = all chapter05 and chapter06 testsuites
|
---|
| 19 | -->
|
---|
[6db1464] | 20 | <xsl:param name="testsuite" select="1"/>
|
---|
[0170229] | 21 |
|
---|
[056486c] | 22 | <!-- Bomb on test suites failures?
|
---|
[47fddc8] | 23 | n = no, I want to build the full system and review the logs
|
---|
| 24 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
[056486c] | 25 | -->
|
---|
[47fddc8] | 26 | <xsl:param name="bomb-testsuite" select="n"/>
|
---|
[056486c] | 27 |
|
---|
[0170229] | 28 | <!-- Install vim-lang package? -->
|
---|
[47fddc8] | 29 | <xsl:param name="vim-lang" select="y"/>
|
---|
[0170229] | 30 |
|
---|
[ad71d98] | 31 | <!-- Time zone -->
|
---|
[e35e794] | 32 | <xsl:param name="timezone" select="GMT"/>
|
---|
[ad71d98] | 33 |
|
---|
| 34 | <!-- Page size -->
|
---|
| 35 | <xsl:param name="page" select="letter"/>
|
---|
| 36 |
|
---|
[3778352] | 37 | <!-- Locale setting -->
|
---|
[e35e794] | 38 | <xsl:param name="lang" select="C"/>
|
---|
[d87b293] | 39 |
|
---|
[13b4ab5] | 40 |
|
---|
| 41 | <!-- ####################################################################### -->
|
---|
| 42 |
|
---|
| 43 | <!-- ########### NAMED USER TEMPLATES TO ALLOW CUSTOMIZATIONS ############## -->
|
---|
| 44 |
|
---|
| 45 | <!-- Hock for user header additions -->
|
---|
| 46 | <xsl:template name="user_header">
|
---|
| 47 | <xsl:text>
</xsl:text>
|
---|
| 48 | </xsl:template>
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | <!-- Hock for user envars or extra commands before cd into the sources dir -->
|
---|
| 52 | <xsl:template name="user_pre_commands">
|
---|
| 53 | <xsl:text>
</xsl:text>
|
---|
| 54 | </xsl:template>
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | <!-- Hock for user footer additions -->
|
---|
| 58 | <xsl:template name="user_footer">
|
---|
| 59 | <xsl:text>
</xsl:text>
|
---|
| 60 | </xsl:template>
|
---|
| 61 |
|
---|
| 62 |
|
---|
[3778352] | 63 | <!-- ####################################################################### -->
|
---|
| 64 |
|
---|
| 65 | <!-- ########################### NAMED TEMPLATES ########################### -->
|
---|
| 66 |
|
---|
| 67 | <!-- Chapter directory name (the same used for HTML output) -->
|
---|
| 68 | <xsl:template name="dirname">
|
---|
| 69 | <xsl:variable name="pi-dir" select="processing-instruction('dbhtml')"/>
|
---|
| 70 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 71 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 72 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
| 73 | <xsl:value-of select="$dirname"/>
|
---|
| 74 | </xsl:template>
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | <!-- Base file name (the same used for HTML output) -->
|
---|
| 78 | <xsl:template name="filename">
|
---|
| 79 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 80 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 81 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 82 | <xsl:value-of select="$filename"/>
|
---|
| 83 | </xsl:template>
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 | <!-- Script header -->
|
---|
| 87 | <xsl:template name="header">
|
---|
[13b4ab5] | 88 | <!-- Set the shabang -->
|
---|
[3778352] | 89 | <xsl:choose>
|
---|
| 90 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
| 91 | @id='ch-system-createfiles' or
|
---|
| 92 | @id='ch-system-strippingagain'">
|
---|
| 93 | <xsl:text>#!/tools/bin/bash
</xsl:text>
|
---|
| 94 | </xsl:when>
|
---|
| 95 | <xsl:otherwise>
|
---|
| 96 | <xsl:text>#!/bin/bash
</xsl:text>
|
---|
| 97 | </xsl:otherwise>
|
---|
| 98 | </xsl:choose>
|
---|
[13b4ab5] | 99 | <!-- Set +h -->
|
---|
[3778352] | 100 | <xsl:text>set +h
</xsl:text>
|
---|
[13b4ab5] | 101 | <!-- Set -e -->
|
---|
[3778352] | 102 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
| 103 | not(@id='ch-system-strippingagain')">
|
---|
| 104 | <xsl:text>set -e
</xsl:text>
|
---|
| 105 | </xsl:if>
|
---|
| 106 | <xsl:text>
</xsl:text>
|
---|
| 107 | </xsl:template>
|
---|
| 108 |
|
---|
| 109 |
|
---|
| 110 | <!-- Extra previous commands needed by the book but not inside screen tags -->
|
---|
| 111 | <xsl:template name="pre_commands">
|
---|
| 112 | <xsl:if test="sect2[@role='installation']">
|
---|
| 113 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
| 114 | </xsl:if>
|
---|
| 115 | <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
|
---|
[e213e4c] | 116 | <xsl:text>tar -xvf ../$TARBALL_1 --strip-components=1
</xsl:text>
|
---|
[3778352] | 117 | </xsl:if>
|
---|
| 118 | </xsl:template>
|
---|
| 119 |
|
---|
| 120 |
|
---|
| 121 | <!-- Extra post commands needed by the book but not inside screen tags -->
|
---|
| 122 | <xsl:template name="post_commands">
|
---|
| 123 | <xsl:if test="$testsuite='3' and @id='ch-tools-glibc'">
|
---|
| 124 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 125 | <xsl:text>
</xsl:text>
|
---|
| 126 | </xsl:if>
|
---|
| 127 | </xsl:template>
|
---|
| 128 |
|
---|
| 129 |
|
---|
| 130 | <!-- Script footer -->
|
---|
| 131 | <xsl:template name="footer">
|
---|
[13b4ab5] | 132 | <!-- Dump the build time -->
|
---|
[3778352] | 133 | <xsl:if test="not(@id='ch-system-chroot') and
|
---|
| 134 | not(@id='ch-system-revisedchroot')">
|
---|
[13b4ab5] | 135 | <xsl:text>

echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
[3778352] | 136 | </xsl:if>
|
---|
[13b4ab5] | 137 | <!-- Exit -->
|
---|
| 138 | <xsl:text>
exit
</xsl:text>
|
---|
| 139 | </xsl:template>
|
---|
[3778352] | 140 |
|
---|
[13b4ab5] | 141 |
|
---|
[fa1b640] | 142 | <!-- Extra commads needed at the start of some screen block
|
---|
| 143 | to allow automatization -->
|
---|
| 144 | <xsl:template name="top_screen_build_fixes">
|
---|
| 145 | <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
|
---|
| 146 | <xsl:if test="contains(string(),'firmware,udev')">
|
---|
| 147 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 148 | </xsl:if>
|
---|
| 149 | </xsl:template>
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 | <!-- Extra commads needed at the end of some screen block
|
---|
| 153 | to allow automatization -->
|
---|
| 154 | <xsl:template name="bottom_screen_build_fixes">
|
---|
| 155 | <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
|
---|
| 156 | <xsl:if test="contains(string(),'firmware,udev')">
|
---|
| 157 | <xsl:text>
fi</xsl:text>
|
---|
| 158 | </xsl:if>
|
---|
| 159 | <!-- Copying the kernel config file -->
|
---|
| 160 | <xsl:if test="string() = 'make mrproper'">
|
---|
| 161 | <xsl:text>
cp -v ../kernel-config .config</xsl:text>
|
---|
| 162 | </xsl:if>
|
---|
| 163 | <!-- Don't stop on strip run -->
|
---|
| 164 | <xsl:if test="contains(string(),'strip --strip')">
|
---|
| 165 | <xsl:text> || true</xsl:text>
|
---|
| 166 | </xsl:if>
|
---|
| 167 | </xsl:template>
|
---|
| 168 |
|
---|
| 169 |
|
---|
[13b4ab5] | 170 | <!-- Extract a package name from a package URL -->
|
---|
| 171 | <xsl:template name="package_name">
|
---|
| 172 | <xsl:param name="url" select="foo"/>
|
---|
| 173 | <xsl:param name="sub-url" select="substring-after($url,'/')"/>
|
---|
| 174 | <xsl:choose>
|
---|
| 175 | <xsl:when test="contains($sub-url,'/')">
|
---|
| 176 | <xsl:call-template name="package_name">
|
---|
| 177 | <xsl:with-param name="url" select="$sub-url"/>
|
---|
| 178 | </xsl:call-template>
|
---|
| 179 | </xsl:when>
|
---|
| 180 | <xsl:otherwise>
|
---|
| 181 | <xsl:value-of select="$sub-url"/>
|
---|
| 182 | </xsl:otherwise>
|
---|
| 183 | </xsl:choose>
|
---|
[3778352] | 184 | </xsl:template>
|
---|
| 185 |
|
---|
[13b4ab5] | 186 |
|
---|
[3778352] | 187 | <!-- ######################################################################## -->
|
---|
| 188 |
|
---|
| 189 | <!-- ############################# MATCH TEMPLATES ########################## -->
|
---|
| 190 |
|
---|
| 191 | <!-- Root element -->
|
---|
[0170229] | 192 | <xsl:template match="/">
|
---|
[13b4ab5] | 193 | <!-- Start processing at chapter level -->
|
---|
[3778352] | 194 | <xsl:apply-templates select="//chapter"/>
|
---|
[0170229] | 195 | </xsl:template>
|
---|
| 196 |
|
---|
[3778352] | 197 |
|
---|
| 198 | <!-- chapter -->
|
---|
| 199 | <xsl:template match="chapter">
|
---|
| 200 | <xsl:if test="@id='chapter-temporary-tools' or @id='chapter-building-system'
|
---|
| 201 | or @id='chapter-bootscripts' or @id='chapter-bootable'">
|
---|
| 202 | <!-- The dir name -->
|
---|
| 203 | <xsl:variable name="dirname">
|
---|
| 204 | <xsl:call-template name="dirname"/>
|
---|
| 205 | </xsl:variable>
|
---|
| 206 | <!-- The chapter order position -->
|
---|
| 207 | <xsl:variable name="ch_position" select="position()"/>
|
---|
| 208 | <xsl:variable name="ch_order">
|
---|
[0170229] | 209 | <xsl:choose>
|
---|
[3778352] | 210 | <xsl:when test="string-length($ch_position) = 1">
|
---|
[0170229] | 211 | <xsl:text>0</xsl:text>
|
---|
[3778352] | 212 | <xsl:value-of select="$ch_position"/>
|
---|
[0170229] | 213 | </xsl:when>
|
---|
| 214 | <xsl:otherwise>
|
---|
[3778352] | 215 | <xsl:value-of select="$ch_position"/>
|
---|
[0170229] | 216 | </xsl:otherwise>
|
---|
| 217 | </xsl:choose>
|
---|
| 218 | </xsl:variable>
|
---|
[13b4ab5] | 219 | <!-- Process the childrens -->
|
---|
[3778352] | 220 | <xsl:apply-templates select="sect1">
|
---|
| 221 | <xsl:with-param name="ch_order" select="$ch_order"/>
|
---|
| 222 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 223 | </xsl:apply-templates>
|
---|
| 224 | </xsl:if>
|
---|
| 225 | </xsl:template>
|
---|
| 226 |
|
---|
| 227 |
|
---|
| 228 | <!-- sect1 -->
|
---|
| 229 | <xsl:template match="sect1">
|
---|
| 230 | <!-- Inherited chapter order -->
|
---|
| 231 | <xsl:param name="ch_order" select="foo"/>
|
---|
| 232 | <!-- Inherited dir name -->
|
---|
| 233 | <xsl:param name="dirname" select="foo"/>
|
---|
[e213e4c] | 234 | <!-- Process only files with actual build commands -->
|
---|
[3778352] | 235 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 236 | count(descendant::screen/userinput) >
|
---|
| 237 | count(descendant::screen[@role='nodump'])">
|
---|
| 238 | <!-- Base file name -->
|
---|
| 239 | <xsl:variable name="filename">
|
---|
| 240 | <xsl:call-template name="filename"/>
|
---|
| 241 | </xsl:variable>
|
---|
| 242 | <!-- Sect1 order position -->
|
---|
| 243 | <xsl:variable name="sect1_position" select="position()"/>
|
---|
| 244 | <xsl:variable name="sect1_order">
|
---|
[0170229] | 245 | <xsl:choose>
|
---|
[3778352] | 246 | <xsl:when test="string-length($sect1_position) = 1">
|
---|
| 247 | <xsl:text>0</xsl:text>
|
---|
| 248 | <xsl:value-of select="$sect1_position"/>
|
---|
[0170229] | 249 | </xsl:when>
|
---|
| 250 | <xsl:otherwise>
|
---|
[3778352] | 251 | <xsl:value-of select="$sect1_position"/>
|
---|
[0170229] | 252 | </xsl:otherwise>
|
---|
| 253 | </xsl:choose>
|
---|
[3778352] | 254 | </xsl:variable>
|
---|
| 255 | <!-- Script build order -->
|
---|
| 256 | <xsl:variable name="order" select="concat($ch_order,'_',$sect1_order)"/>
|
---|
| 257 | <!-- Creating dirs and files -->
|
---|
| 258 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
| 259 | <xsl:call-template name="header"/>
|
---|
[13b4ab5] | 260 | <xsl:call-template name="user_header"/>
|
---|
| 261 | <xsl:apply-templates select="sect1info[@condition='script']">
|
---|
| 262 | <xsl:with-param name="phase" select="$filename"/>
|
---|
| 263 | </xsl:apply-templates>
|
---|
| 264 | <xsl:call-template name="user_pre_commands"/>
|
---|
[3778352] | 265 | <xsl:call-template name="pre_commands"/>
|
---|
[9c9775f] | 266 | <xsl:apply-templates select=".//screen"/>
|
---|
[3778352] | 267 | <xsl:call-template name="post_commands"/>
|
---|
[13b4ab5] | 268 | <xsl:call-template name="user_footer"/>
|
---|
[3778352] | 269 | <xsl:call-template name="footer"/>
|
---|
[0170229] | 270 | </exsl:document>
|
---|
| 271 | </xsl:if>
|
---|
| 272 | </xsl:template>
|
---|
| 273 |
|
---|
[3778352] | 274 |
|
---|
[13b4ab5] | 275 | <!-- sect1info -->
|
---|
| 276 | <xsl:template match="sect1info">
|
---|
| 277 | <!-- Build phase (base file name) to be used for PM -->
|
---|
| 278 | <xsl:param name="phase" select="foo"/>
|
---|
| 279 | <xsl:text>
PKG_PHASE=</xsl:text>
|
---|
| 280 | <xsl:value-of select="$phase"/>
|
---|
| 281 | <!-- Package name -->
|
---|
| 282 | <xsl:apply-templates select="productname"/>
|
---|
| 283 | <!-- Package version -->
|
---|
| 284 | <xsl:apply-templates select="productnumber"/>
|
---|
| 285 | <!-- Tarball name -->
|
---|
| 286 | <xsl:apply-templates select="address"/>
|
---|
| 287 | <xsl:text>

</xsl:text>
|
---|
| 288 | </xsl:template>
|
---|
| 289 |
|
---|
| 290 |
|
---|
| 291 | <!-- productname -->
|
---|
| 292 | <xsl:template match="productname">
|
---|
| 293 | <xsl:text>
PACKAGE=</xsl:text>
|
---|
| 294 | <xsl:apply-templates/>
|
---|
| 295 | </xsl:template>
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | <!-- productnumber -->
|
---|
| 299 | <xsl:template match="productnumber">
|
---|
| 300 | <xsl:text>
VERSION=</xsl:text>
|
---|
| 301 | <xsl:apply-templates/>
|
---|
| 302 | </xsl:template>
|
---|
| 303 |
|
---|
| 304 |
|
---|
| 305 | <!-- address -->
|
---|
| 306 | <xsl:template match="address">
|
---|
| 307 | <xsl:text>
TARBALL=</xsl:text>
|
---|
| 308 | <xsl:call-template name="package_name">
|
---|
| 309 | <xsl:with-param name="url">
|
---|
| 310 | <xsl:apply-templates/>
|
---|
| 311 | </xsl:with-param>
|
---|
| 312 | </xsl:call-template>
|
---|
| 313 | <xsl:apply-templates select="otheraddr" mode="tarball"/>
|
---|
| 314 | </xsl:template>
|
---|
[3778352] | 315 |
|
---|
| 316 |
|
---|
[13b4ab5] | 317 | <!-- otheraddr -->
|
---|
| 318 | <xsl:template match="otheraddr"/>
|
---|
| 319 | <xsl:template match="otheraddr" mode="tarball">
|
---|
| 320 | <xsl:text>
TARBALL_</xsl:text>
|
---|
| 321 | <xsl:value-of select="position()"/>
|
---|
| 322 | <xsl:text>=</xsl:text>
|
---|
| 323 | <xsl:call-template name="package_name">
|
---|
| 324 | <xsl:with-param name="url" select="."/>
|
---|
| 325 | </xsl:call-template>
|
---|
| 326 | </xsl:template>
|
---|
[3778352] | 327 |
|
---|
| 328 |
|
---|
[13b4ab5] | 329 | <!-- screen -->
|
---|
[0170229] | 330 | <xsl:template match="screen">
|
---|
[6db1464] | 331 | <xsl:if test="child::* = userinput and not(@role = 'nodump')">
|
---|
[fa1b640] | 332 | <xsl:call-template name="top_screen_build_fixes"/>
|
---|
| 333 | <xsl:apply-templates/>
|
---|
| 334 | <xsl:call-template name="bottom_screen_build_fixes"/>
|
---|
| 335 | <xsl:text>
</xsl:text>
|
---|
[0170229] | 336 | </xsl:if>
|
---|
| 337 | </xsl:template>
|
---|
| 338 |
|
---|
[13b4ab5] | 339 |
|
---|
[fa1b640] | 340 | <!-- userinput @remap='pre' -->
|
---|
| 341 | <xsl:template match="userinput[@remap='pre']">
|
---|
| 342 | <xsl:apply-templates select="." mode="pre"/>
|
---|
| 343 | </xsl:template>
|
---|
| 344 |
|
---|
| 345 |
|
---|
| 346 | <!-- userinput @remap='configure' -->
|
---|
| 347 | <xsl:template match="userinput[@remap='configure']">
|
---|
| 348 | <xsl:apply-templates select="." mode="configure"/>
|
---|
| 349 | </xsl:template>
|
---|
| 350 |
|
---|
| 351 |
|
---|
| 352 | <!-- userinput @remap='make' -->
|
---|
| 353 | <xsl:template match="userinput[@remap='make']">
|
---|
| 354 | <xsl:apply-templates select="." mode="make"/>
|
---|
| 355 | </xsl:template>
|
---|
| 356 |
|
---|
| 357 |
|
---|
| 358 | <!-- userinput @remap='test' -->
|
---|
| 359 | <xsl:template match="userinput[@remap='test']">
|
---|
| 360 | <xsl:apply-templates select="." mode="test"/>
|
---|
| 361 | </xsl:template>
|
---|
| 362 |
|
---|
| 363 |
|
---|
| 364 | <!-- userinput @remap='install' -->
|
---|
| 365 | <xsl:template match="userinput[@remap='install']">
|
---|
| 366 | <xsl:apply-templates select="." mode="install"/>
|
---|
| 367 | </xsl:template>
|
---|
| 368 |
|
---|
| 369 |
|
---|
| 370 | <!-- userinput @remap='adjust' -->
|
---|
| 371 | <xsl:template match="userinput[@remap='adjust']">
|
---|
| 372 | <xsl:apply-templates select="." mode="adjust"/>
|
---|
| 373 | </xsl:template>
|
---|
| 374 |
|
---|
| 375 |
|
---|
| 376 | <!-- userinput @remap='locale-test' -->
|
---|
| 377 | <xsl:template match="userinput[@remap='locale-test']">
|
---|
| 378 | <xsl:apply-templates select="." mode="locale-test"/>
|
---|
| 379 | </xsl:template>
|
---|
| 380 |
|
---|
| 381 |
|
---|
| 382 | <!-- userinput @remap='locale-full' -->
|
---|
| 383 | <xsl:template match="userinput[@remap='locale-full']">
|
---|
| 384 | <xsl:apply-templates select="." mode="locale-full"/>
|
---|
| 385 | </xsl:template>
|
---|
| 386 |
|
---|
| 387 |
|
---|
| 388 |
|
---|
| 389 | <!-- userinput without @remap -->
|
---|
[13b4ab5] | 390 | <xsl:template match="userinput">
|
---|
[0170229] | 391 | <xsl:choose>
|
---|
[fa1b640] | 392 | <xsl:when test="ancestor::sect2[@role='configuration']">
|
---|
| 393 | <xsl:apply-templates select="." mode="configuration_section"/>
|
---|
[e213e4c] | 394 | </xsl:when>
|
---|
| 395 | <xsl:otherwise>
|
---|
[fa1b640] | 396 | <xsl:apply-templates select="." mode="no_remap"/>
|
---|
[e213e4c] | 397 | </xsl:otherwise>
|
---|
| 398 | </xsl:choose>
|
---|
| 399 | </xsl:template>
|
---|
| 400 |
|
---|
| 401 |
|
---|
| 402 | <!-- replaceable -->
|
---|
| 403 | <xsl:template match="replaceable">
|
---|
| 404 | <xsl:choose>
|
---|
| 405 | <!-- Configuring the Time Zone -->
|
---|
| 406 | <xsl:when test="ancestor::sect2[@id='conf-glibc'] and string()='<xxx>'">
|
---|
| 407 | <xsl:value-of select="$timezone"/>
|
---|
| 408 | </xsl:when>
|
---|
| 409 | <!-- Set paper size for Groff build -->
|
---|
| 410 | <xsl:when test="string()='<paper_size>'">
|
---|
| 411 | <xsl:value-of select="$page"/>
|
---|
| 412 | </xsl:when>
|
---|
| 413 | <!-- LANG setting in /etc/profile -->
|
---|
| 414 | <xsl:when test="contains(string(),'<ll>_<CC>')">
|
---|
| 415 | <xsl:value-of select="$lang"/>
|
---|
| 416 | </xsl:when>
|
---|
| 417 | <xsl:otherwise>
|
---|
| 418 | <xsl:text>**EDITME</xsl:text>
|
---|
| 419 | <xsl:apply-templates/>
|
---|
| 420 | <xsl:text>EDITME**</xsl:text>
|
---|
| 421 | </xsl:otherwise>
|
---|
| 422 | </xsl:choose>
|
---|
| 423 | </xsl:template>
|
---|
| 424 |
|
---|
| 425 |
|
---|
| 426 | <!-- ######################################################################## -->
|
---|
| 427 |
|
---|
| 428 | <!-- ############################# MODE TEMPLATES ########################### -->
|
---|
| 429 |
|
---|
| 430 |
|
---|
| 431 | <!-- mode test -->
|
---|
| 432 | <xsl:template match="userinput" mode="test">
|
---|
| 433 | <xsl:choose>
|
---|
| 434 | <!-- No testsuites run on level 0 -->
|
---|
| 435 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 436 | <!-- On level 1, only final system toolchain testsuites are run -->
|
---|
| 437 | <xsl:when test="$testsuite = '1' and
|
---|
| 438 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 439 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
| 440 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 441 | <!-- On level 2, temp tools testsuites are not run -->
|
---|
| 442 | <xsl:when test="$testsuite = '2' and
|
---|
| 443 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 444 | <!-- Start testsuites command fixes -->
|
---|
| 445 | <xsl:otherwise>
|
---|
[e35e794] | 446 | <xsl:choose>
|
---|
[e213e4c] | 447 | <!-- Final system Glibc -->
|
---|
| 448 | <xsl:when test="contains(string(),'glibc-check-log')">
|
---|
| 449 | <xsl:value-of select="substring-before(string(),'2>&1')"/>
|
---|
| 450 | <xsl:text>>> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
| 451 | </xsl:when>
|
---|
| 452 | <!-- Module-Init-Tools -->
|
---|
| 453 | <xsl:when test="ancestor::sect1[@id='ch-system-module-init-tools']
|
---|
| 454 | and contains(string(),'make check')">
|
---|
| 455 | <xsl:value-of select="substring-before(string(),' check')"/>
|
---|
| 456 | <xsl:if test="$bomb-testsuite = 'n'">
|
---|
| 457 | <xsl:text> -k</xsl:text>
|
---|
[e35e794] | 458 | </xsl:if>
|
---|
[e213e4c] | 459 | <xsl:text> check >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 460 | <xsl:if test="$bomb-testsuite = 'n'">
|
---|
| 461 | <xsl:text> || true</xsl:text>
|
---|
[9c9775f] | 462 | </xsl:if>
|
---|
[e213e4c] | 463 | <xsl:value-of select="substring-after(string(),' check')"/>
|
---|
[6db1464] | 464 | </xsl:when>
|
---|
[e213e4c] | 465 | <!-- If the book uses -k, the testsuite should never bomb -->
|
---|
| 466 | <xsl:when test="contains(string(),'make -k ')">
|
---|
| 467 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 468 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
[6db1464] | 469 | </xsl:when>
|
---|
[e213e4c] | 470 | <!-- Extra commands in Binutils and GCC -->
|
---|
| 471 | <xsl:when test="contains(string(),'test_summary') or
|
---|
| 472 | contains(string(),'expect -c')">
|
---|
| 473 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 474 | <xsl:text> >> $TEST_LOG</xsl:text>
|
---|
[6db1464] | 475 | </xsl:when>
|
---|
[e213e4c] | 476 | <!-- Remaining extra testsuite commads that don't need be hacked -->
|
---|
| 477 | <xsl:when test="not(contains(string(),'make '))">
|
---|
| 478 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 479 | </xsl:when>
|
---|
| 480 | <!-- Normal testsites run -->
|
---|
[9c9775f] | 481 | <xsl:otherwise>
|
---|
| 482 | <xsl:choose>
|
---|
[e213e4c] | 483 | <!-- No bomb on failures -->
|
---|
[9c9775f] | 484 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[e213e4c] | 485 | <xsl:value-of select="substring-before(string(),'make ')"/>
|
---|
| 486 | <xsl:text>make -k </xsl:text>
|
---|
| 487 | <xsl:value-of select="substring-after(string(),'make ')"/>
|
---|
| 488 | <xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
---|
[9c9775f] | 489 | </xsl:when>
|
---|
[e213e4c] | 490 | <!-- Bomb at the first failure -->
|
---|
[9c9775f] | 491 | <xsl:otherwise>
|
---|
[e213e4c] | 492 | <xsl:apply-templates select="." mode="default"/>
|
---|
[9c9775f] | 493 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 494 | </xsl:otherwise>
|
---|
| 495 | </xsl:choose>
|
---|
| 496 | </xsl:otherwise>
|
---|
| 497 | </xsl:choose>
|
---|
[0170229] | 498 | </xsl:otherwise>
|
---|
| 499 | </xsl:choose>
|
---|
| 500 | </xsl:template>
|
---|
| 501 |
|
---|
[e213e4c] | 502 |
|
---|
| 503 | <!-- mode pre -->
|
---|
| 504 | <xsl:template match="userinput" mode="pre">
|
---|
| 505 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 506 | </xsl:template>
|
---|
| 507 |
|
---|
| 508 |
|
---|
| 509 | <!-- mode configure -->
|
---|
| 510 | <xsl:template match="userinput" mode="configure">
|
---|
| 511 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 512 | </xsl:template>
|
---|
| 513 |
|
---|
| 514 |
|
---|
| 515 | <!-- mode make -->
|
---|
| 516 | <xsl:template match="userinput" mode="make">
|
---|
| 517 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 518 | </xsl:template>
|
---|
| 519 |
|
---|
| 520 |
|
---|
| 521 | <!-- mode install -->
|
---|
| 522 | <xsl:template match="userinput" mode="install">
|
---|
| 523 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 524 | </xsl:template>
|
---|
| 525 |
|
---|
| 526 |
|
---|
| 527 | <!-- mode adjust -->
|
---|
| 528 | <xsl:template match="userinput" mode="adjust">
|
---|
| 529 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 530 | </xsl:template>
|
---|
| 531 |
|
---|
| 532 |
|
---|
| 533 | <!-- mode locale-test -->
|
---|
| 534 | <xsl:template match="userinput" mode="locale-test">
|
---|
| 535 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 536 | </xsl:template>
|
---|
| 537 |
|
---|
| 538 |
|
---|
| 539 | <!-- mode locale-full -->
|
---|
| 540 | <xsl:template match="userinput" mode="locale-full">
|
---|
| 541 | <xsl:apply-templates select="." mode="default"/>
|
---|
[0170229] | 542 | </xsl:template>
|
---|
| 543 |
|
---|
[fa1b640] | 544 |
|
---|
| 545 | <!-- mode configuration_section -->
|
---|
| 546 | <xsl:template match="userinput" mode="configuration_section">
|
---|
| 547 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 548 | </xsl:template>
|
---|
| 549 |
|
---|
| 550 |
|
---|
| 551 | <!-- mode no_remap -->
|
---|
| 552 | <xsl:template match="userinput" mode="no_remap">
|
---|
| 553 | <xsl:apply-templates select="." mode="default"/>
|
---|
| 554 | </xsl:template>
|
---|
| 555 |
|
---|
| 556 |
|
---|
| 557 | <!-- mode default -->
|
---|
| 558 | <xsl:template match="userinput" mode="default">
|
---|
| 559 | <xsl:apply-templates/>
|
---|
| 560 | </xsl:template>
|
---|
| 561 |
|
---|
[0170229] | 562 | </xsl:stylesheet>
|
---|