source: LFS/lfs.xsl@ 097df00

experimental
Last change on this file since 097df00 was 097df00, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added hocks for inserting scripts before and/or after a selected one.

  • Property mode set to 100644
File size: 23.1 KB
RevLine 
[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 -->
[c0f8256]20 <xsl:param name="testsuite">1</xsl:param>
[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 -->
[c0f8256]26 <xsl:param name="bomb-testsuite">n</xsl:param>
[056486c]27
[0170229]28 <!-- Install vim-lang package? -->
[c0f8256]29 <xsl:param name="vim-lang">y</xsl:param>
[0170229]30
[ad71d98]31 <!-- Time zone -->
[c0f8256]32 <xsl:param name="timezone">GMT</xsl:param>
[ad71d98]33
34 <!-- Page size -->
[c0f8256]35 <xsl:param name="page">letter</xsl:param>
[ad71d98]36
[3778352]37 <!-- Locale setting -->
[c0f8256]38 <xsl:param name="lang">C</xsl:param>
39
40 <!-- Custom tools support -->
41 <xsl:param name="custom-tools">n</xsl:param>
42
43 <!-- blfs-tool support -->
44 <xsl:param name="blfs-tool">n</xsl:param>
[d87b293]45
[13b4ab5]46
47<!-- ####################################################################### -->
48
49<!-- ########### NAMED USER TEMPLATES TO ALLOW CUSTOMIZATIONS ############## -->
50
51 <!-- Hock for user header additions -->
52 <xsl:template name="user_header">
53 <xsl:text>&#xA;</xsl:text>
54 </xsl:template>
55
56
57 <!-- Hock for user envars or extra commands before cd into the sources dir -->
58 <xsl:template name="user_pre_commands">
59 <xsl:text>&#xA;</xsl:text>
60 </xsl:template>
61
62
63 <!-- Hock for user footer additions -->
64 <xsl:template name="user_footer">
65 <xsl:text>&#xA;</xsl:text>
66 </xsl:template>
67
68
[097df00]69 <!-- Hock for inserting scripts before a selected one -->
70 <xsl:template name="insert_script_before">
71 <!-- Inherited values -->
72 <xsl:param name="reference" select="foo"/>
73 <xsl:param name="order" select="foo"/>
74 <!-- Add a string to be sure that this scripts are run
75 before the selected one -->
76 <xsl:variable name="insert_order" select="concat($order,'_0')"/>
77 <!-- Add an xsl:if block for each referenced sect1 you want
78 to insert scripts before -->
79 <xsl:if test="$reference = 'ID_of_selected_sect1'">
80 <!-- Add an exsl:document block for each script to be inserted
81 at this point of the build. This one is only a dummy example.
82 You must replace "dummy" by the script name and increase "01" -->
83 <exsl:document href="{$insert_order}01-dummy" method="text">
84 <xsl:call-template name="header"/>
85 <xsl:text>
86PKG_PHASE=dummy
87PACKAGE=dummy
88VERSION=0.0.0
89TARBALL=dummy-0.0.0.tar.bz2
90
91cd $PKGDIR
92./configure --prefix=/usr
93make
94make check
95make install
96 </xsl:text>
97 <xsl:call-template name="footer"/>
98 </exsl:document>
99 </xsl:if>
100 </xsl:template>
101
102
103 <!-- Hock for inserting scripts after a selected one -->
104 <xsl:template name="insert_script_after">
105 <!-- Inherited values -->
106 <xsl:param name="reference" select="foo"/>
107 <xsl:param name="order" select="foo"/>
108 <!-- Add a string to be sure that this scripts are run
109 after the selected one -->
110 <xsl:variable name="insert_order" select="concat($order,'_z')"/>
111 <!-- Add an xsl:if block for each referenced sect1 you want
112 to insert scripts after -->
113 <xsl:if test="$reference = 'ID_of_selected_sect1'">
114 <!-- Add an exsl:document block for each script to be inserted
115 at this point of the build. This one is only a dummy example. -->
116 <exsl:document href="{$insert_order}01-dummy" method="text">
117 <xsl:call-template name="header"/>
118 <xsl:text>
119PKG_PHASE=dummy
120PACKAGE=dummy
121VERSION=0.0.0
122TARBALL=dummy-0.0.0.tar.bz2
123
124cd $PKGDIR
125./configure --prefix=/usr
126make
127make check
128make install
129 </xsl:text>
130 <xsl:call-template name="footer"/>
131 </exsl:document>
132 </xsl:if>
133 </xsl:template>
134
135
[c0f8256]136 <!-- Hock for creating a custom tools directory containing scripts
137 to be run after the system has been built -->
138 <xsl:template name="custom-tools">
[097df00]139 <!-- Fixed directory and ch_order values -->
[c0f8256]140 <xsl:variable name="basedir">custom-tools/20_</xsl:variable>
[097df00]141 <!-- Add an exsl:document block for each script to be created.
[c0f8256]142 This one is only a dummy example. You must replace "01" by
143 the proper build order and "dummy" by the script name -->
144 <exsl:document href="{$basedir}01-dummy" method="text">
145 <xsl:call-template name="header"/>
146 <xsl:text>
147PKG_PHASE=dummy
148PACKAGE=dummy
149VERSION=0.0.0
150TARBALL=dummy-0.0.0.tar.bz2
151
152cd $PKGDIR
153./configure --prefix=/usr
154make
155make check
156make install
157 </xsl:text>
158 <xsl:call-template name="footer"/>
159 </exsl:document>
160 </xsl:template>
161
162
[3778352]163<!-- ####################################################################### -->
164
165<!-- ########################### NAMED TEMPLATES ########################### -->
166
167 <!-- Chapter directory name (the same used for HTML output) -->
168 <xsl:template name="dirname">
169 <xsl:variable name="pi-dir" select="processing-instruction('dbhtml')"/>
170 <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
171 <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
172 <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
173 <xsl:value-of select="$dirname"/>
174 </xsl:template>
175
176
177 <!-- Base file name (the same used for HTML output) -->
178 <xsl:template name="filename">
179 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
180 <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
181 <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
182 <xsl:value-of select="$filename"/>
183 </xsl:template>
184
185
186 <!-- Script header -->
187 <xsl:template name="header">
[13b4ab5]188 <!-- Set the shabang -->
[3778352]189 <xsl:choose>
190 <xsl:when test="@id='ch-system-creatingdirs' or
191 @id='ch-system-createfiles' or
192 @id='ch-system-strippingagain'">
193 <xsl:text>#!/tools/bin/bash&#xA;</xsl:text>
194 </xsl:when>
195 <xsl:otherwise>
196 <xsl:text>#!/bin/bash&#xA;</xsl:text>
197 </xsl:otherwise>
198 </xsl:choose>
[13b4ab5]199 <!-- Set +h -->
[3778352]200 <xsl:text>set +h&#xA;</xsl:text>
[13b4ab5]201 <!-- Set -e -->
[3778352]202 <xsl:if test="not(@id='ch-tools-stripping') and
203 not(@id='ch-system-strippingagain')">
204 <xsl:text>set -e&#xA;</xsl:text>
205 </xsl:if>
206 <xsl:text>&#xA;</xsl:text>
207 </xsl:template>
208
209
210 <!-- Extra previous commands needed by the book but not inside screen tags -->
211 <xsl:template name="pre_commands">
212 <xsl:if test="sect2[@role='installation']">
213 <xsl:text>cd $PKGDIR&#xA;</xsl:text>
214 </xsl:if>
215 <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
[e213e4c]216 <xsl:text>tar -xvf ../$TARBALL_1 --strip-components=1&#xA;</xsl:text>
[3778352]217 </xsl:if>
218 </xsl:template>
219
220
221 <!-- Extra post commands needed by the book but not inside screen tags -->
222 <xsl:template name="post_commands">
223 <xsl:if test="$testsuite='3' and @id='ch-tools-glibc'">
224 <xsl:copy-of select="//userinput[@remap='locale-test']"/>
225 <xsl:text>&#xA;</xsl:text>
226 </xsl:if>
227 </xsl:template>
228
229
230 <!-- Script footer -->
231 <xsl:template name="footer">
[13b4ab5]232 <!-- Dump the build time -->
[3778352]233 <xsl:if test="not(@id='ch-system-chroot') and
234 not(@id='ch-system-revisedchroot')">
[13b4ab5]235 <xsl:text>&#xA;&#xA;echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
[3778352]236 </xsl:if>
[13b4ab5]237 <!-- Exit -->
238 <xsl:text>&#xA;exit&#xA;</xsl:text>
239 </xsl:template>
[3778352]240
[13b4ab5]241
[fa1b640]242 <!-- Extra commads needed at the start of some screen block
243 to allow automatization -->
244 <xsl:template name="top_screen_build_fixes">
245 <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
246 <xsl:if test="contains(string(),'firmware,udev')">
247 <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
248 </xsl:if>
249 </xsl:template>
250
251
252 <!-- Extra commads needed at the end of some screen block
253 to allow automatization -->
254 <xsl:template name="bottom_screen_build_fixes">
255 <!-- Fix Udev reinstallation after a build failure or on iterative builds -->
256 <xsl:if test="contains(string(),'firmware,udev')">
257 <xsl:text>&#xA;fi</xsl:text>
258 </xsl:if>
259 <!-- Copying the kernel config file -->
260 <xsl:if test="string() = 'make mrproper'">
261 <xsl:text>&#xA;cp -v ../kernel-config .config</xsl:text>
262 </xsl:if>
263 <!-- Don't stop on strip run -->
264 <xsl:if test="contains(string(),'strip --strip')">
265 <xsl:text> || true</xsl:text>
266 </xsl:if>
267 </xsl:template>
268
269
[13b4ab5]270 <!-- Extract a package name from a package URL -->
271 <xsl:template name="package_name">
272 <xsl:param name="url" select="foo"/>
273 <xsl:param name="sub-url" select="substring-after($url,'/')"/>
274 <xsl:choose>
275 <xsl:when test="contains($sub-url,'/')">
276 <xsl:call-template name="package_name">
277 <xsl:with-param name="url" select="$sub-url"/>
278 </xsl:call-template>
279 </xsl:when>
280 <xsl:otherwise>
281 <xsl:value-of select="$sub-url"/>
282 </xsl:otherwise>
283 </xsl:choose>
[3778352]284 </xsl:template>
285
[13b4ab5]286
[c0f8256]287 <!-- Adds blfs-tool support scripts -->
288 <xsl:template name="blfs-tool">
[097df00]289 <!-- Fixed directory and ch_order values -->
[c0f8256]290 <xsl:variable name="basedir">blfs-tool-deps/30_</xsl:variable>
291 <!-- One exsl:document block for each blfs-tool dependency
292 TO BE WRITTEN -->
293 <exsl:document href="{$basedir}01-dummy" method="text">
294 <xsl:call-template name="header"/>
295 <xsl:text>
296PKG_PHASE=dummy
297PACKAGE=dummy
298VERSION=0.0.0
299TARBALL=dummy-0.0.0.tar.bz2
300
301cd $PKGDIR
302./configure --prefix=/usr
303make
304make check
305make install
306 </xsl:text>
307 <xsl:call-template name="footer"/>
308 </exsl:document>
309 </xsl:template>
310
311
[3778352]312<!-- ######################################################################## -->
313
314<!-- ############################# MATCH TEMPLATES ########################## -->
315
316 <!-- Root element -->
[0170229]317 <xsl:template match="/">
[13b4ab5]318 <!-- Start processing at chapter level -->
[3778352]319 <xsl:apply-templates select="//chapter"/>
[c0f8256]320 <!-- Process custom tools scripts -->
321 <xsl:if test="$custom-tools = 'y'">
322 <xsl:call-template name="custom-tools"/>
323 </xsl:if>
324 <!-- Process blfs-tool scripts -->
325 <xsl:if test="$blfs-tool = 'y'">
326 <xsl:call-template name="blfs-tool"/>
327 </xsl:if>
[0170229]328 </xsl:template>
329
[3778352]330
331 <!-- chapter -->
332 <xsl:template match="chapter">
333 <xsl:if test="@id='chapter-temporary-tools' or @id='chapter-building-system'
334 or @id='chapter-bootscripts' or @id='chapter-bootable'">
335 <!-- The dir name -->
336 <xsl:variable name="dirname">
337 <xsl:call-template name="dirname"/>
338 </xsl:variable>
339 <!-- The chapter order position -->
340 <xsl:variable name="ch_position" select="position()"/>
341 <xsl:variable name="ch_order">
[0170229]342 <xsl:choose>
[3778352]343 <xsl:when test="string-length($ch_position) = 1">
[0170229]344 <xsl:text>0</xsl:text>
[3778352]345 <xsl:value-of select="$ch_position"/>
[0170229]346 </xsl:when>
347 <xsl:otherwise>
[3778352]348 <xsl:value-of select="$ch_position"/>
[0170229]349 </xsl:otherwise>
350 </xsl:choose>
351 </xsl:variable>
[13b4ab5]352 <!-- Process the childrens -->
[3778352]353 <xsl:apply-templates select="sect1">
354 <xsl:with-param name="ch_order" select="$ch_order"/>
355 <xsl:with-param name="dirname" select="$dirname"/>
356 </xsl:apply-templates>
357 </xsl:if>
358 </xsl:template>
359
360
361 <!-- sect1 -->
362 <xsl:template match="sect1">
363 <!-- Inherited chapter order -->
364 <xsl:param name="ch_order" select="foo"/>
365 <!-- Inherited dir name -->
366 <xsl:param name="dirname" select="foo"/>
[e213e4c]367 <!-- Process only files with actual build commands -->
[3778352]368 <xsl:if test="count(descendant::screen/userinput) &gt; 0 and
369 count(descendant::screen/userinput) &gt;
370 count(descendant::screen[@role='nodump'])">
371 <!-- Base file name -->
372 <xsl:variable name="filename">
373 <xsl:call-template name="filename"/>
374 </xsl:variable>
375 <!-- Sect1 order position -->
376 <xsl:variable name="sect1_position" select="position()"/>
377 <xsl:variable name="sect1_order">
[0170229]378 <xsl:choose>
[3778352]379 <xsl:when test="string-length($sect1_position) = 1">
380 <xsl:text>0</xsl:text>
381 <xsl:value-of select="$sect1_position"/>
[0170229]382 </xsl:when>
383 <xsl:otherwise>
[3778352]384 <xsl:value-of select="$sect1_position"/>
[0170229]385 </xsl:otherwise>
386 </xsl:choose>
[3778352]387 </xsl:variable>
388 <!-- Script build order -->
[097df00]389 <xsl:variable name="order" select="concat($dirname,'/',$ch_order,'_',$sect1_order)"/>
390 <!-- Hock to insert scripts before the current one -->
391 <xsl:call-template name="insert_script_before">
392 <xsl:with-param name="reference" select="@id"/>
393 <xsl:with-param name="order" select="$order"/>
394 </xsl:call-template>
[3778352]395 <!-- Creating dirs and files -->
[097df00]396 <exsl:document href="{$order}-{$filename}" method="text">
[3778352]397 <xsl:call-template name="header"/>
[13b4ab5]398 <xsl:call-template name="user_header"/>
399 <xsl:apply-templates select="sect1info[@condition='script']">
400 <xsl:with-param name="phase" select="$filename"/>
401 </xsl:apply-templates>
402 <xsl:call-template name="user_pre_commands"/>
[3778352]403 <xsl:call-template name="pre_commands"/>
[9c9775f]404 <xsl:apply-templates select=".//screen"/>
[3778352]405 <xsl:call-template name="post_commands"/>
[13b4ab5]406 <xsl:call-template name="user_footer"/>
[3778352]407 <xsl:call-template name="footer"/>
[0170229]408 </exsl:document>
[097df00]409 <!-- Hock to insert scripts after the current one -->
410 <xsl:call-template name="insert_script_after">
411 <xsl:with-param name="reference" select="@id"/>
412 <xsl:with-param name="order" select="$order"/>
413 </xsl:call-template>
[0170229]414 </xsl:if>
415 </xsl:template>
416
[3778352]417
[13b4ab5]418 <!-- sect1info -->
419 <xsl:template match="sect1info">
420 <!-- Build phase (base file name) to be used for PM -->
421 <xsl:param name="phase" select="foo"/>
422 <xsl:text>&#xA;PKG_PHASE=</xsl:text>
423 <xsl:value-of select="$phase"/>
424 <!-- Package name -->
425 <xsl:apply-templates select="productname"/>
426 <!-- Package version -->
427 <xsl:apply-templates select="productnumber"/>
428 <!-- Tarball name -->
429 <xsl:apply-templates select="address"/>
430 <xsl:text>&#xA;&#xA;</xsl:text>
431 </xsl:template>
432
433
434 <!-- productname -->
435 <xsl:template match="productname">
436 <xsl:text>&#xA;PACKAGE=</xsl:text>
437 <xsl:apply-templates/>
438 </xsl:template>
439
440
441 <!-- productnumber -->
442 <xsl:template match="productnumber">
443 <xsl:text>&#xA;VERSION=</xsl:text>
444 <xsl:apply-templates/>
445 </xsl:template>
446
447
448 <!-- address -->
449 <xsl:template match="address">
450 <xsl:text>&#xA;TARBALL=</xsl:text>
451 <xsl:call-template name="package_name">
452 <xsl:with-param name="url">
453 <xsl:apply-templates/>
454 </xsl:with-param>
455 </xsl:call-template>
456 <xsl:apply-templates select="otheraddr" mode="tarball"/>
457 </xsl:template>
[3778352]458
459
[13b4ab5]460 <!-- otheraddr -->
461 <xsl:template match="otheraddr"/>
462 <xsl:template match="otheraddr" mode="tarball">
463 <xsl:text>&#xA;TARBALL_</xsl:text>
464 <xsl:value-of select="position()"/>
465 <xsl:text>=</xsl:text>
466 <xsl:call-template name="package_name">
467 <xsl:with-param name="url" select="."/>
468 </xsl:call-template>
469 </xsl:template>
[3778352]470
471
[13b4ab5]472 <!-- screen -->
[0170229]473 <xsl:template match="screen">
[6db1464]474 <xsl:if test="child::* = userinput and not(@role = 'nodump')">
[fa1b640]475 <xsl:call-template name="top_screen_build_fixes"/>
476 <xsl:apply-templates/>
477 <xsl:call-template name="bottom_screen_build_fixes"/>
478 <xsl:text>&#xA;</xsl:text>
[0170229]479 </xsl:if>
480 </xsl:template>
481
[13b4ab5]482
[fa1b640]483 <!-- userinput @remap='pre' -->
484 <xsl:template match="userinput[@remap='pre']">
485 <xsl:apply-templates select="." mode="pre"/>
486 </xsl:template>
487
488
489 <!-- userinput @remap='configure' -->
490 <xsl:template match="userinput[@remap='configure']">
491 <xsl:apply-templates select="." mode="configure"/>
492 </xsl:template>
493
494
495 <!-- userinput @remap='make' -->
496 <xsl:template match="userinput[@remap='make']">
497 <xsl:apply-templates select="." mode="make"/>
498 </xsl:template>
499
500
501 <!-- userinput @remap='test' -->
502 <xsl:template match="userinput[@remap='test']">
503 <xsl:apply-templates select="." mode="test"/>
504 </xsl:template>
505
506
507 <!-- userinput @remap='install' -->
508 <xsl:template match="userinput[@remap='install']">
509 <xsl:apply-templates select="." mode="install"/>
510 </xsl:template>
511
512
513 <!-- userinput @remap='adjust' -->
514 <xsl:template match="userinput[@remap='adjust']">
515 <xsl:apply-templates select="." mode="adjust"/>
516 </xsl:template>
517
518
519 <!-- userinput @remap='locale-test' -->
520 <xsl:template match="userinput[@remap='locale-test']">
521 <xsl:apply-templates select="." mode="locale-test"/>
522 </xsl:template>
523
524
525 <!-- userinput @remap='locale-full' -->
526 <xsl:template match="userinput[@remap='locale-full']">
527 <xsl:apply-templates select="." mode="locale-full"/>
528 </xsl:template>
529
530
531
532 <!-- userinput without @remap -->
[13b4ab5]533 <xsl:template match="userinput">
[0170229]534 <xsl:choose>
[fa1b640]535 <xsl:when test="ancestor::sect2[@role='configuration']">
536 <xsl:apply-templates select="." mode="configuration_section"/>
[e213e4c]537 </xsl:when>
538 <xsl:otherwise>
[fa1b640]539 <xsl:apply-templates select="." mode="no_remap"/>
[e213e4c]540 </xsl:otherwise>
541 </xsl:choose>
542 </xsl:template>
543
544
545 <!-- replaceable -->
546 <xsl:template match="replaceable">
547 <xsl:choose>
548 <!-- Configuring the Time Zone -->
549 <xsl:when test="ancestor::sect2[@id='conf-glibc'] and string()='&lt;xxx&gt;'">
550 <xsl:value-of select="$timezone"/>
551 </xsl:when>
552 <!-- Set paper size for Groff build -->
553 <xsl:when test="string()='&lt;paper_size&gt;'">
554 <xsl:value-of select="$page"/>
555 </xsl:when>
556 <!-- LANG setting in /etc/profile -->
557 <xsl:when test="contains(string(),'&lt;ll&gt;_&lt;CC&gt;')">
558 <xsl:value-of select="$lang"/>
559 </xsl:when>
560 <xsl:otherwise>
561 <xsl:text>**EDITME</xsl:text>
562 <xsl:apply-templates/>
563 <xsl:text>EDITME**</xsl:text>
564 </xsl:otherwise>
565 </xsl:choose>
566 </xsl:template>
567
568
569<!-- ######################################################################## -->
570
571<!-- ############################# MODE TEMPLATES ########################### -->
572
573
574 <!-- mode test -->
575 <xsl:template match="userinput" mode="test">
576 <xsl:choose>
577 <!-- No testsuites run on level 0 -->
578 <xsl:when test="$testsuite = '0'"/>
579 <!-- On level 1, only final system toolchain testsuites are run -->
580 <xsl:when test="$testsuite = '1' and
581 not(ancestor::sect1[@id='ch-system-gcc']) and
582 not(ancestor::sect1[@id='ch-system-glibc']) and
583 not(ancestor::sect1[@id='ch-system-binutils'])"/>
584 <!-- On level 2, temp tools testsuites are not run -->
585 <xsl:when test="$testsuite = '2' and
586 ancestor::chapter[@id='chapter-temporary-tools']"/>
587 <!-- Start testsuites command fixes -->
588 <xsl:otherwise>
[e35e794]589 <xsl:choose>
[e213e4c]590 <!-- Final system Glibc -->
591 <xsl:when test="contains(string(),'glibc-check-log')">
592 <xsl:value-of select="substring-before(string(),'2&gt;&amp;1')"/>
593 <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
594 </xsl:when>
595 <!-- Module-Init-Tools -->
596 <xsl:when test="ancestor::sect1[@id='ch-system-module-init-tools']
597 and contains(string(),'make check')">
598 <xsl:value-of select="substring-before(string(),' check')"/>
599 <xsl:if test="$bomb-testsuite = 'n'">
600 <xsl:text> -k</xsl:text>
[e35e794]601 </xsl:if>
[e213e4c]602 <xsl:text> check &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
603 <xsl:if test="$bomb-testsuite = 'n'">
604 <xsl:text> || true</xsl:text>
[9c9775f]605 </xsl:if>
[e213e4c]606 <xsl:value-of select="substring-after(string(),' check')"/>
[6db1464]607 </xsl:when>
[e213e4c]608 <!-- If the book uses -k, the testsuite should never bomb -->
609 <xsl:when test="contains(string(),'make -k ')">
610 <xsl:apply-templates select="." mode="default"/>
611 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
[6db1464]612 </xsl:when>
[e213e4c]613 <!-- Extra commands in Binutils and GCC -->
614 <xsl:when test="contains(string(),'test_summary') or
615 contains(string(),'expect -c')">
616 <xsl:apply-templates select="." mode="default"/>
617 <xsl:text> &gt;&gt; $TEST_LOG</xsl:text>
[6db1464]618 </xsl:when>
[e213e4c]619 <!-- Remaining extra testsuite commads that don't need be hacked -->
620 <xsl:when test="not(contains(string(),'make '))">
621 <xsl:apply-templates select="." mode="default"/>
622 </xsl:when>
623 <!-- Normal testsites run -->
[9c9775f]624 <xsl:otherwise>
625 <xsl:choose>
[e213e4c]626 <!-- No bomb on failures -->
[9c9775f]627 <xsl:when test="$bomb-testsuite = 'n'">
[e213e4c]628 <xsl:value-of select="substring-before(string(),'make ')"/>
629 <xsl:text>make -k </xsl:text>
630 <xsl:value-of select="substring-after(string(),'make ')"/>
631 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
[9c9775f]632 </xsl:when>
[e213e4c]633 <!-- Bomb at the first failure -->
[9c9775f]634 <xsl:otherwise>
[e213e4c]635 <xsl:apply-templates select="." mode="default"/>
[9c9775f]636 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
637 </xsl:otherwise>
638 </xsl:choose>
639 </xsl:otherwise>
640 </xsl:choose>
[0170229]641 </xsl:otherwise>
642 </xsl:choose>
643 </xsl:template>
644
[e213e4c]645
646 <!-- mode pre -->
647 <xsl:template match="userinput" mode="pre">
648 <xsl:apply-templates select="." mode="default"/>
649 </xsl:template>
650
651
652 <!-- mode configure -->
653 <xsl:template match="userinput" mode="configure">
654 <xsl:apply-templates select="." mode="default"/>
655 </xsl:template>
656
657
658 <!-- mode make -->
659 <xsl:template match="userinput" mode="make">
660 <xsl:apply-templates select="." mode="default"/>
661 </xsl:template>
662
663
664 <!-- mode install -->
665 <xsl:template match="userinput" mode="install">
666 <xsl:apply-templates select="." mode="default"/>
667 </xsl:template>
668
669
670 <!-- mode adjust -->
671 <xsl:template match="userinput" mode="adjust">
672 <xsl:apply-templates select="." mode="default"/>
673 </xsl:template>
674
675
676 <!-- mode locale-test -->
677 <xsl:template match="userinput" mode="locale-test">
678 <xsl:apply-templates select="." mode="default"/>
679 </xsl:template>
680
681
682 <!-- mode locale-full -->
683 <xsl:template match="userinput" mode="locale-full">
684 <xsl:apply-templates select="." mode="default"/>
[0170229]685 </xsl:template>
686
[fa1b640]687
688 <!-- mode configuration_section -->
689 <xsl:template match="userinput" mode="configuration_section">
690 <xsl:apply-templates select="." mode="default"/>
691 </xsl:template>
692
693
694 <!-- mode no_remap -->
695 <xsl:template match="userinput" mode="no_remap">
696 <xsl:apply-templates select="." mode="default"/>
697 </xsl:template>
698
699
700 <!-- mode default -->
701 <xsl:template match="userinput" mode="default">
702 <xsl:apply-templates/>
703 </xsl:template>
704
[0170229]705</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.