source: LFS/lfs.xsl@ a659e46

ablfs-more legacy trunk
Last change on this file since a659e46 was f5e658d, checked in by Pierre Labastie <pierre@…>, 6 years ago

Fix filename extension in /etc/sysconfig/ifconfig.xxx so that it matches
the IFACE value. Works only with revision 11556 or later of LFS book.

  • Property mode set to 100644
File size: 46.0 KB
RevLine 
[7072e1f]1<?xml version="1.0" encoding="ISO-8859-1"?>
[db181c47]2
[877cc6a]3<!-- $Id$ -->
4
[7072e1f]5<xsl:stylesheet
6 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 xmlns:exsl="http://exslt.org/common"
8 extension-element-prefixes="exsl"
9 version="1.0">
[557fe91]10
[945ccaa]11<!-- Parameters -->
12
[0ad3a33]13 <!-- which revision attribute to include: can only be sysv or systemd,
14 but we leave checking to the caller-->
15 <xsl:param name="revision" select="'sysv'"/>
16
[7072e1f]17 <!-- use package management ?
18 n = no, original behavior
19 y = yes, add PKG_DEST to scripts in install commands of chapter06-08
20 -->
[945ccaa]21 <xsl:param name="pkgmngt" select="'n'"/>
22
23 <!-- Package management with "porg style" ?
24 n = no, same as pkgmngt description above
25 y = yes, wrap install commands of chapter06-08 into a bash function.
26 note that pkgmngt must be 'y' in this case
27 -->
28 <xsl:param name="wrap-install" select='"n"'/>
[2e1c1c3]29
[31d6944]30 <!-- Run test suites?
31 0 = none
[945ccaa]32 1 = only chapter06 critical testsuites
[31d6944]33 2 = all chapter06 testsuites
[28f4756]34 3 = all chapter05 and chapter06 testsuites
35 -->
[31d6944]36 <xsl:param name="testsuite" select="1"/>
[01e51a1]37
[28f4756]38 <!-- Bomb on test suites failures?
[401f81e]39 n = no, I want to build the full system and review the logs
40 y = yes, bomb at the first test suite failure to can review the build dir
[28f4756]41 -->
[945ccaa]42 <xsl:param name="bomb-testsuite" select="'n'"/>
[28f4756]43
[7072e1f]44 <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
[945ccaa]45 <xsl:param name="vim-lang" select="'n'"/>
[2e1c1c3]46
[dc7fd7b]47 <!-- Should we strip excutables and libraries? -->
48 <xsl:param name='strip' select="'n'"/>
49
50 <!-- Should we remove .la files after chapter 5 and chapter 6? -->
51 <xsl:param name='del-la-files' select="'y'"/>
52
[877cc6a]53 <!-- Time zone -->
[945ccaa]54 <xsl:param name="timezone" select="'GMT'"/>
[2e1c1c3]55
[877cc6a]56 <!-- Page size -->
[945ccaa]57 <xsl:param name="page" select="'letter'"/>
[2e1c1c3]58
[877cc6a]59 <!-- Locale settings -->
[945ccaa]60 <xsl:param name="lang" select="'C'"/>
[b339c94]61
62 <!-- Install the whole set of locales -->
[945ccaa]63 <xsl:param name='full-locale' select='"n"'/>
[2e1c1c3]64
[945ccaa]65 <!-- Hostname -->
66 <xsl:param name='hostname' select='"HOSTNAME"'/>
67
68 <!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
69 and nameservers -->
70 <xsl:param name='interface' select="'eth0'"/>
71 <xsl:param name='ip' select='"10.0.2.9"'/>
72 <xsl:param name='gateway' select='"10.0.2.2"'/>
73 <xsl:param name='prefix' select='24'/>
74 <xsl:param name='broadcast' select='"10.0.2.255"'/>
75 <xsl:param name='domain' select='"lfs.org"'/>
76 <xsl:param name='nameserver1' select='"10.0.2.3"'/>
77 <xsl:param name='nameserver2' select='"8.8.8.8"'/>
78
[3b43e17b]79 <!-- Console parameters: font, fontmap, unicode (y/n), keymap, local (y:
80 hardware clock set to local time/n:hardware clock set to UTC)
81 and log-level -->
82 <xsl:param name='font' select="'lat0-16'"/>
83 <xsl:param name='keymap' select="'us'"/>
84 <xsl:param name='local' select="'n'"/>
85 <xsl:param name='log-level' select="'4'"/>
86
[945ccaa]87<!-- End parameters -->
88
[557fe91]89 <xsl:template match="/">
[0ad3a33]90 <xsl:apply-templates select="//sect1[not(@revision) or
91 @revision=$revision]"/>
[557fe91]92 </xsl:template>
[2e1c1c3]93
[557fe91]94 <xsl:template match="sect1">
[1814367]95<!-- Since this xsl:if tag encloses the whole template, it would
96 be much better to transpose this condition to the select part
97 of the "calling" apply-template. But that would change the numbering,
98 so that it would be difficult to compare to previous versions. So for
99 version 2.4, let us keep this -->
[7072e1f]100 <xsl:if test="(../@id='chapter-temporary-tools' or
[14eaa9f]101 ../@id='chapter-building-system' or
102 ../@id='chapter-bootscripts' or
103 ../@id='chapter-bootable') and
[1814367]104 (sect2[not(@revision) or @revision=$revision]//..|.)/
105 screen[(not(@role) or @role != 'nodump') and
106 (not(@revision) or @revision=$revision)]/
107 userinput[not(starts-with(string(),'chroot'))]">
[d68eb1b]108<!-- The last condition is a hack to allow previous versions of the
109 book where the chroot commands did not have role="nodump".
110 It only works if the chroot command is the only one on the page -->
[c4cf6de]111 <!-- The dirs names -->
112 <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
113 <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
114 <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
115 <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
[7072e1f]116 <!-- The file names -->
117 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
118 <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
119 <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
120 <!-- The build order -->
121 <xsl:variable name="position" select="position()"/>
122 <xsl:variable name="order">
123 <xsl:choose>
124 <xsl:when test="string-length($position) = 1">
125 <xsl:text>00</xsl:text>
126 <xsl:value-of select="$position"/>
127 </xsl:when>
128 <xsl:when test="string-length($position) = 2">
129 <xsl:text>0</xsl:text>
130 <xsl:value-of select="$position"/>
131 </xsl:when>
132 <xsl:otherwise>
133 <xsl:value-of select="$position"/>
134 </xsl:otherwise>
135 </xsl:choose>
136 </xsl:variable>
137 <!-- Inclusion of package manager scriptlets -->
138 <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
139 <xsl:apply-templates
[575bcf3]140 select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
[7072e1f]141 mode="pkgmngt">
[575bcf3]142 <xsl:with-param name="order" select="$order"/>
[7072e1f]143 <xsl:with-param name="dirname" select="$dirname"/>
144 </xsl:apply-templates>
145 </xsl:if>
146 <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
147 <xsl:apply-templates
[575bcf3]148 select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
[7072e1f]149 mode="pkgmngt">
[575bcf3]150 <xsl:with-param name="order" select="$order"/>
[7072e1f]151 <xsl:with-param name="dirname" select="$dirname"/>
152 </xsl:apply-templates>
153 </xsl:if>
154 <!-- Creating dirs and files -->
155 <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
156 <xsl:choose>
157 <xsl:when test="@id='ch-system-creatingdirs' or
[2e1c1c3]158 @id='ch-system-createfiles' or
[7072e1f]159 @id='ch-system-strippingagain'">
160 <xsl:text>#!/tools/bin/bash&#xA;set +h&#xA;</xsl:text>
161 </xsl:when>
162 <xsl:otherwise>
163 <xsl:text>#!/bin/bash&#xA;set +h&#xA;</xsl:text>
164 </xsl:otherwise>
165 </xsl:choose>
166 <xsl:if test="not(@id='ch-tools-stripping') and
167 not(@id='ch-system-strippingagain')">
168 <xsl:text>set -e&#xA;</xsl:text>
169 </xsl:if>
170 <xsl:text>&#xA;</xsl:text>
171 <xsl:if test="sect2[@role='installation']">
172 <xsl:text>cd $PKGDIR&#xA;</xsl:text>
173 </xsl:if>
[0ad3a33]174 <xsl:apply-templates select="sect2[not(@revision) or
175 @revision=$revision] |
176 screen[(not(@role) or
177 @role!='nodump') and
178 (not(@revision) or
179 @revision=$revision)]/userinput"/>
[e6e0c85]180 <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
[f0a31de]181 <xsl:apply-templates
182 select="document('packageManager.xml')//sect1[
183 @id='ch-pkgmngt-creatingdirs'
[e6e0c85]184 ]//userinput"
185 mode="pkgmngt"/>
[f0a31de]186 </xsl:if>
[e6e0c85]187 <xsl:if test="@id='ch-system-createfiles' and $pkgmngt='y'">
[f0a31de]188 <xsl:apply-templates
189 select="document('packageManager.xml')//sect1[
190 @id='ch-pkgmngt-createfiles'
[e6e0c85]191 ]//userinput"
192 mode="pkgmngt"/>
[f0a31de]193 </xsl:if>
[d68eb1b]194 <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
[f0a31de]195 <xsl:text>exit&#xA;</xsl:text>
196 </exsl:document>
197 </xsl:if>
198 </xsl:template>
199
200 <xsl:template match="sect2">
201 <xsl:apply-templates
[0ad3a33]202 select=".//screen[(not(@role) or
203 @role != 'nodump') and
204 (not(@revision) or
205 @revision=$revision)]/userinput[
[f0a31de]206 @remap = 'pre' or
207 @remap = 'configure' or
208 @remap = 'make' or
209 @remap = 'test' and
[f2e80ac]210 not(current()/../@id='ch-tools-dejagnu') and
211 not(current()/../@id='ch-system-systemd')]"/>
[f0a31de]212 <xsl:if
213 test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
214 $pkgmngt = 'y' and
215 descendant::screen[not(@role) or
216 @role != 'nodump']/userinput[
217 @remap='install']">
[945ccaa]218 <xsl:choose>
219 <xsl:when test="$wrap-install='y'">
220 <xsl:text>wrapInstall '
221</xsl:text>
222 </xsl:when>
223 <xsl:otherwise>
224 <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
[7072e1f]225mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
226mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
227mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
228ln -sv share/{man,doc,info} $PKG_DEST/usr
229case $(uname -m) in
230 x86_64) ln -sv lib $PKG_DEST/lib64 &amp;&amp; ln -sv lib $PKG_DEST/usr/lib64 ;;
231esac
232</xsl:text>
[945ccaa]233 </xsl:otherwise>
234 </xsl:choose>
[f0a31de]235 </xsl:if>
236 <xsl:if test="../@id = 'ch-system-glibc' and
[90f304c]237 @role='installation' and
[945ccaa]238 $pkgmngt = 'y' and
239 $wrap-install = 'n'">
[f0a31de]240 <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
[7bc70cd]241</xsl:text>
242 </xsl:if>
243 <xsl:if test="../@id = 'ch-system-libelf' and
244 @role='installation' and
245 $pkgmngt = 'y' and
246 $wrap-install = 'n'">
247 <xsl:text>mkdir -pv $PKG_DEST/usr/lib/pkgconfig
[7072e1f]248</xsl:text>
[f0a31de]249 </xsl:if>
250 <xsl:apply-templates
[0ad3a33]251 select=".//screen[(not(@role) or
252 @role != 'nodump') and
253 (not(@revision) or
254 @revision=$revision)]/userinput[@remap = 'install']"/>
[f0a31de]255 <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
256 descendant::screen[not(@role) or
257 @role != 'nodump']/userinput[
258 @remap='install']">
[945ccaa]259 <xsl:choose>
[dc7fd7b]260 <xsl:when test="$pkgmngt='n'"/>
[945ccaa]261 <xsl:when test="$wrap-install='y'">
262 <xsl:if test="../@id = 'ch-system-man-pages'">
[560bef1]263<!-- these files are provided by the shadow package -->
[945ccaa]264 <xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
[560bef1]265</xsl:text>
[945ccaa]266 </xsl:if>
[560bef1]267<!-- Attr man/man2 pages are already installed by man-pages. As of
[00313dd]268 March 2013, they are the same pages.
269 November 2015: now they are more accurate
270 in man-pages, and the man5 section is also in man-pages... -->
[945ccaa]271 <xsl:if test="../@id = 'ch-system-attr'">
272 <xsl:text>rm -fv /usr/share/man/man2/*
273rm -fv /usr/share/man/man5/*
274</xsl:text>
275 </xsl:if>
276<!-- nologin is installed by util-linux. remove it from shadow -->
277 <xsl:if test="../@id = 'ch-system-shadow'">
278 <xsl:text>rm -fv /usr/share/man/man8/nologin.8
279rm -fv /sbin/nologin
280</xsl:text>
281 </xsl:if>
282 <xsl:text>'
[9bbb9c8]283PREV_SEC=${SECONDS}
[945ccaa]284packInstall
[9bbb9c8]285SECONDS=${PREV_SEC}
[945ccaa]286</xsl:text>
287 </xsl:when>
288 <xsl:otherwise>
289 <xsl:if test="../@id = 'ch-system-man-pages'">
290<!-- these files are provided by the shadow package -->
291 <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
292</xsl:text>
293 </xsl:if>
294<!-- Attr man/man2 pages are already installed by man-pages. As of
295 March 2013, they are the same pages.
296 November 2015: now they are more accurate
297 in man-pages, and the man5 section is also in man-pages... -->
298 <xsl:if test="../@id = 'ch-system-attr'">
299 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
[00313dd]300rm -fv $PKG_DEST/usr/share/man/man5/*
[a983256]301</xsl:text>
[945ccaa]302 </xsl:if>
[a983256]303<!-- nologin is installed by util-linux. remove it from shadow -->
[945ccaa]304 <xsl:if test="../@id = 'ch-system-shadow'">
305 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
[a983256]306rm -fv $PKG_DEST/sbin/nologin
[7072e1f]307</xsl:text>
[945ccaa]308 </xsl:if>
309 <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
[7072e1f]310rm -fv $PKG_DEST/usr/{man,doc,info}
311for dir in $PKG_DEST/usr/share/man/man{1..8}; do
312 [[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
313done
314for dir in $PKG_DEST/usr/share/{doc,info,man}; do
315 [[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
316done
317for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
318 [[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
319done
320for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
321 [[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
322done
[9bbb9c8]323PREV_SEC=${SECONDS}
[7072e1f]324packInstall
[9bbb9c8]325SECONDS=${PREV_SEC}
[7072e1f]326rm -rf $PKG_DEST
327</xsl:text>
[945ccaa]328 </xsl:otherwise>
329 </xsl:choose>
[f0a31de]330 </xsl:if>
331 <xsl:if test="$testsuite='3' and
332 ../@id='ch-tools-glibc' and
333 @role='installation'">
334 <xsl:copy-of select="//userinput[@remap='locale-test']"/>
335 <xsl:text>&#xA;</xsl:text>
336 </xsl:if>
337 <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
338 <xsl:choose>
339 <xsl:when test="$full-locale='y'">
340 <xsl:copy-of select="//userinput[@remap='locale-full']"/>
341 <xsl:text>&#xA;</xsl:text>
342 </xsl:when>
343 <xsl:otherwise>
344 <xsl:copy-of select="//userinput[@remap='locale-test']"/>
345 <xsl:text>&#xA;</xsl:text>
346 <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
347 <xsl:text>if LOCALE=`grep "</xsl:text>
348 <xsl:value-of select="$lang"/>
349 <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
[b339c94]350 CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
351 INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
352 LOCALE=`echo $LOCALE | sed 's,/.*,,'`
353 localedef -i $INPUT -f $CHARMAP $LOCALE
354fi
355</xsl:text>
[f0a31de]356 </xsl:if>
357 </xsl:otherwise>
358 </xsl:choose>
[c4cf6de]359 </xsl:if>
[f0a31de]360 <xsl:apply-templates
361 select=".//screen[
[0ad3a33]362 (not(@role) or
363 @role != 'nodump') and
364 (not(@revision) or
365 @revision=$revision)
[f0a31de]366 ]/userinput[
[f2e80ac]367 not(@remap) or
368 @remap='adjust' or
369 @remap='test' and current()/../@id='ch-tools-dejagnu' or
370 @remap='test' and current()/../@id='ch-system-systemd'
[f0a31de]371 ]"/>
[557fe91]372 </xsl:template>
373
[f0a31de]374 <xsl:template match="sect1" mode="pkgmngt">
[7072e1f]375 <xsl:param name="dirname" select="chapter05"/>
376 <!-- The build order -->
[575bcf3]377 <xsl:param name="order" select="062"/>
[7072e1f]378<!-- The file names -->
379 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
380 <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
381 <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
382 <!-- Creating dirs and files -->
[8099885]383 <xsl:if test="count(descendant::screen/userinput) &gt; 0 and
384 count(descendant::screen/userinput) &gt;
385 count(descendant::screen[@role='nodump'])">
386 <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
387 method="text">
388 <xsl:text>#!/bin/bash
[7072e1f]389set +h
390set -e
391
392cd $PKGDIR
393</xsl:text>
[8099885]394 <xsl:apply-templates
395 select=".//screen[not(@role) or
396 @role != 'nodump']/userinput[@remap != 'adjust']"
[7072e1f]397 mode="pkgmngt"/>
[8099885]398 <xsl:if test="$dirname = 'chapter06'">
[9bbb9c8]399 <xsl:text>PREV_SEC=${SECONDS}
400packInstall
401SECONDS=${PREV_SEC}
[945ccaa]402rm -rf "$PKG_DEST"
[7072e1f]403</xsl:text>
[8099885]404 </xsl:if>
405 <xsl:apply-templates
406 select=".//screen[not(@role) or
407 @role != 'nodump'
408 ]/userinput[not(@remap) or
409 @remap='adjust'
[7072e1f]410 ]"
411 mode="pkgmngt"/>
[8099885]412 <xsl:text>
[7072e1f]413echo -e "\n\nTotalseconds: $SECONDS\n"
414exit
415</xsl:text>
[8099885]416 </exsl:document>
417 </xsl:if>
[557fe91]418 </xsl:template>
419
[7072e1f]420 <xsl:template match="userinput" mode="pkgmngt">
421 <xsl:apply-templates/>
422 <xsl:text>&#xA;</xsl:text>
423 </xsl:template>
[2e1c1c3]424
[7072e1f]425 <xsl:template match="userinput">
[3eb60fa]426 <xsl:choose>
[fd691b4]427 <!-- Copying the kernel config file -->
428 <xsl:when test="string() = 'make mrproper'">
429 <xsl:text>make mrproper&#xA;</xsl:text>
[7072e1f]430 <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
[bcfb3bf]431 <xsl:text>cp -v ../kernel-config .config&#xA;</xsl:text>
432 </xsl:if>
[92568bf]433 </xsl:when>
[7072e1f]434<!-- test instructions -->
[1d5f3e3]435 <xsl:when test="@remap = 'test'">
[5a8939e]436 <xsl:call-template name="comment-test">
437 <xsl:with-param name="instructions" select="string()"/>
438 </xsl:call-template>
[4afcedb]439 </xsl:when>
[7072e1f]440<!-- End of test instructions -->
[dc7fd7b]441<!-- If the instructions contain "strip ", it may mean they contain also .la
442 file removal (and possibly other clean up). We therefore call a template
443 to comment them out appropriately and also to not stop if stripping
444 fails. -->
445 <xsl:when test="contains(string(),'strip ') or
446 contains(string(),'\*.la')">
447 <xsl:call-template name="comment-strip">
448 <xsl:with-param name="instructions" select="string()"/>
449 </xsl:call-template>
[1f025ca]450 </xsl:when>
[7072e1f]451<!-- Package management -->
452<!-- Add $PKG_DEST to installation commands -->
453 <xsl:when test="@remap='install' and
454 not(ancestor::chapter[
455 @id='chapter-temporary-tools'
456 ])">
457 <xsl:choose>
458 <xsl:when test="$pkgmngt='n'">
459 <xsl:choose>
460 <xsl:when test="contains(string(),'firmware,udev')">
461 <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
462 <xsl:apply-templates/>
463 <xsl:text>&#xA;fi&#xA;</xsl:text>
464 </xsl:when>
465 <xsl:otherwise>
466 <xsl:apply-templates/>
467 <xsl:text>&#xA;</xsl:text>
468 </xsl:otherwise>
469 </xsl:choose>
470 </xsl:when>
[945ccaa]471 <xsl:when test="$wrap-install='y'">
472 <xsl:choose>
473 <xsl:when test="./literal">
474 <xsl:call-template name="output-wrap">
475 <xsl:with-param name="commands" select="text()[1]"/>
476 </xsl:call-template>
477 <xsl:apply-templates select="literal"/>
478 <xsl:call-template name="output-wrap">
479 <xsl:with-param name="commands" select="text()[2]"/>
480 </xsl:call-template>
481 </xsl:when>
482 <xsl:otherwise>
483 <xsl:call-template name="output-wrap">
484 <xsl:with-param name="commands" select="string()"/>
485 </xsl:call-template>
486 </xsl:otherwise>
487 </xsl:choose>
488 <xsl:text>&#xA;</xsl:text>
489 </xsl:when>
490 <xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
[7072e1f]491 <xsl:choose>
492 <xsl:when test="./literal">
493 <xsl:call-template name="outputpkgdest">
[560bef1]494 <xsl:with-param name="outputstring" select="text()[1]"/>
[7072e1f]495 </xsl:call-template>
496 <xsl:apply-templates select="literal"/>
497 <xsl:call-template name="outputpkgdest">
[560bef1]498 <xsl:with-param name="outputstring" select="text()[2]"/>
[7072e1f]499 </xsl:call-template>
500 </xsl:when>
501 <xsl:otherwise>
502 <xsl:call-template name="outputpkgdest">
503 <xsl:with-param name="outputstring" select="string()"/>
504 </xsl:call-template>
505 </xsl:otherwise>
506 </xsl:choose>
[ad747ed]507 <xsl:text>&#xA;</xsl:text>
[7072e1f]508 </xsl:otherwise>
509 </xsl:choose>
[dc7fd7b]510 </xsl:when> <!-- @remap='install' -->
[57ef0c1]511 <!-- if package management, we should make an independant package for
512 tzdata. -->
513 <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
514 <xsl:text>
[945ccaa]515OLD_PKG_DEST="$PKG_DEST"
[57ef0c1]516OLD_PKGDIR=$PKGDIR
[56d8426]517PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
[57ef0c1]518PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
519 <xsl:copy-of select="substring-before(
520 substring-after(string(),'tzdata'),
521 '.tar')"/>
522 <xsl:text>
523</xsl:text>
[945ccaa]524 <xsl:choose>
525 <xsl:when test="$wrap-install='n'">
526 <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
527 <xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
528 <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
529 <xsl:text>
[9bbb9c8]530PREV_SEC=${SECONDS}
[57ef0c1]531packInstall
[9bbb9c8]532SECONDS=${PREV_SEC}
[57ef0c1]533rm -rf $PKG_DEST
[945ccaa]534</xsl:text>
535 </xsl:when>
536 <xsl:otherwise><!-- wrap-install='y' -->
537 <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
538 <xsl:text>
539wrapInstall '
540ZONEINFO=</xsl:text>
541 <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
542 <xsl:text>'
[9bbb9c8]543PREV_SEC=${SECONDS}
[945ccaa]544packInstall
[9bbb9c8]545SECONDS=${PREV_SEC}
[945ccaa]546</xsl:text>
547 </xsl:otherwise>
548 </xsl:choose>
549 <xsl:text>
[57ef0c1]550PKG_DEST=$OLD_PKG_DEST
551unset OLD_PKG_DEST
552PKGDIR=$OLD_PKGDIR
553unset OLD_PKGDIR
554</xsl:text>
555 </xsl:when><!-- addition for tzdata + package management -->
[7072e1f]556 <!-- End addition for package management -->
[fd691b4]557 <!-- The rest of commands -->
[1f025ca]558 <xsl:otherwise>
559 <xsl:apply-templates/>
[fd691b4]560 <xsl:text>&#xA;</xsl:text>
[1f025ca]561 </xsl:otherwise>
562 </xsl:choose>
563 </xsl:template>
[2e1c1c3]564
[557fe91]565 <xsl:template match="replaceable">
[a41ce58]566 <xsl:choose>
[2a54650]567 <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
[877cc6a]568 <xsl:value-of select="$timezone"/>
[2a54650]569 </xsl:when>
[a41ce58]570 <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
[877cc6a]571 <xsl:value-of select="$page"/>
[a41ce58]572 </xsl:when>
[81a7fb8]573 <xsl:when test="contains(string(.),'&lt;ll&gt;_&lt;CC&gt;')">
574 <xsl:value-of select="$lang"/>
575 </xsl:when>
[945ccaa]576 <xsl:when test="contains(string(.),'Domain')">
577 <xsl:value-of select="$domain"/>
578 </xsl:when>
579 <xsl:when test="contains(string(.),'primary')">
580 <xsl:value-of select="$nameserver1"/>
581 </xsl:when>
582 <xsl:when test="contains(string(.),'secondary')">
583 <xsl:value-of select="$nameserver2"/>
584 </xsl:when>
585 <xsl:when test="contains(string(.),'192.168.1.1')">
586 <xsl:value-of select="$ip"/>
587 </xsl:when>
588 <xsl:when test="contains(string(.),'192.168.0.2')">
589 <xsl:value-of select="$ip"/>
590 </xsl:when>
[f5e658d]591 <xsl:when test="contains(string(.),'eth0')">
592 <xsl:value-of select="$interface"/>
593 </xsl:when>
[945ccaa]594<!-- Only adapted to LFS-20170310 and later -->
595 <xsl:when test="contains(string(.),'HOSTNAME')">
596 <xsl:value-of select="$hostname"/>
597 </xsl:when>
598 <xsl:when test="contains(string(.),'FQDN')">
599 <xsl:value-of select="$hostname"/>
600 <xsl:text>.</xsl:text>
601 <xsl:value-of select="$domain"/>
602 </xsl:when>
603 <xsl:when test="contains(string(.),'alias')"/>
604 <xsl:when test="contains(string(.),'&lt;lfs&gt;')">
605 <xsl:value-of select="$hostname"/>
606 </xsl:when>
[a41ce58]607 <xsl:otherwise>
608 <xsl:text>**EDITME</xsl:text>
609 <xsl:apply-templates/>
610 <xsl:text>EDITME**</xsl:text>
611 </xsl:otherwise>
612 </xsl:choose>
[557fe91]613 </xsl:template>
[2e1c1c3]614
[945ccaa]615 <xsl:template match="literal">
616 <xsl:choose>
617 <xsl:when test="contains(string(),'ONBOOT')">
618 <xsl:call-template name="outputnet">
619 <xsl:with-param name="netstring" select="string()"/>
620 </xsl:call-template>
621 </xsl:when>
622 <xsl:when test="contains(string(),'[Match]')">
623 <xsl:call-template name="outputsysdnet">
624 <xsl:with-param name="netstring" select="string()"/>
625 </xsl:call-template>
626 </xsl:when>
[3b43e17b]627 <xsl:when test="contains(string(),'0.0 0 0.0')">
628 <xsl:copy-of select="substring-before(string(),'LOCAL')"/>
629 <xsl:if test="$local='y'"><xsl:text>LOCAL</xsl:text></xsl:if>
630 <xsl:if test="$local='n'"><xsl:text>UTC</xsl:text></xsl:if>
631 </xsl:when>
632 <xsl:when test="contains(string(),'UTC=1')">
633 <xsl:copy-of select="substring-before(string(),'1')"/>
634 <xsl:if test="$local='y'"><xsl:text>0</xsl:text></xsl:if>
635 <xsl:if test="$local='n'"><xsl:text>1</xsl:text></xsl:if>
636 <xsl:copy-of select="substring-after(string(),'1')"/>
637 </xsl:when>
638 <xsl:when test="contains(string(),'bg_bds-')">
639 <xsl:call-template name="outputsysvconsole">
640 <xsl:with-param name="consolestring" select="string()"/>
641 </xsl:call-template>
642 </xsl:when>
643 <xsl:when test="contains(string(),'de-latin1')">
644 <xsl:call-template name="outputsysdconsole">
645 <xsl:with-param name="consolestring" select="string()"/>
646 </xsl:call-template>
647 </xsl:when>
[945ccaa]648 <xsl:otherwise>
649 <xsl:apply-templates/>
650 </xsl:otherwise>
651 </xsl:choose>
652 </xsl:template>
653
654 <xsl:template name="outputnet">
655 <xsl:param name="netstring" select="''"/>
656 <!-- We suppose that book example has the following values:
657 - interface: eth0
658 - ip: 192.168.1.2
659 - gateway: 192.168.1.1
660 - prefix: 24
661 - broadcast: 192.168.1.255
662 Change below if book changes -->
663 <xsl:choose>
664 <xsl:when test="contains($netstring,'eth0')">
665 <xsl:call-template name="outputnet">
666 <xsl:with-param name="netstring"
667 select="substring-before($netstring,'eth0')"/>
668 </xsl:call-template>
669 <xsl:value-of select="$interface"/>
670 <xsl:call-template name="outputnet">
671 <xsl:with-param name="netstring"
672 select="substring-after($netstring,'eth0')"/>
673 </xsl:call-template>
674 </xsl:when>
675 <xsl:when test="contains($netstring,'192.168.1.1')">
676 <xsl:call-template name="outputnet">
677 <xsl:with-param name="netstring"
678 select="substring-before($netstring,'192.168.1.1')"/>
679 </xsl:call-template>
680 <xsl:value-of select="$gateway"/>
681 <xsl:call-template name="outputnet">
682 <xsl:with-param name="netstring"
683 select="substring-after($netstring,'192.168.1.1')"/>
684 </xsl:call-template>
685 </xsl:when>
686 <!-- must test this before the following, because 192.168.1.255 contains
687 192.168.1.2! -->
688 <xsl:when test="contains($netstring,'192.168.1.255')">
689 <xsl:call-template name="outputnet">
690 <xsl:with-param name="netstring"
691 select="substring-before($netstring,'192.168.1.255')"/>
692 </xsl:call-template>
693 <xsl:value-of select="$broadcast"/>
694 <xsl:call-template name="outputnet">
695 <xsl:with-param name="netstring"
696 select="substring-after($netstring,'192.168.1.255')"/>
697 </xsl:call-template>
698 </xsl:when>
699 <xsl:when test="contains($netstring,'192.168.1.2')">
700 <xsl:call-template name="outputnet">
701 <xsl:with-param name="netstring"
702 select="substring-before($netstring,'192.168.1.2')"/>
703 </xsl:call-template>
704 <xsl:value-of select="$ip"/>
705 <xsl:call-template name="outputnet">
706 <xsl:with-param name="netstring"
707 select="substring-after($netstring,'192.168.1.2')"/>
708 </xsl:call-template>
709 </xsl:when>
710 <xsl:when test="contains($netstring,'24')">
711 <xsl:call-template name="outputnet">
712 <xsl:with-param name="netstring"
713 select="substring-before($netstring,'24')"/>
714 </xsl:call-template>
715 <xsl:value-of select="$prefix"/>
716 <xsl:call-template name="outputnet">
717 <xsl:with-param name="netstring"
718 select="substring-after($netstring,'24')"/>
719 </xsl:call-template>
720 </xsl:when>
721 <xsl:otherwise>
722 <xsl:value-of select="$netstring"/>
723 </xsl:otherwise>
724 </xsl:choose>
725 </xsl:template>
726
727 <xsl:template name="outputsysdnet">
728 <xsl:param name="netstring" select="''"/>
729 <!-- We suppose that book example has the following values:
[5af9ab4]730 - interface: <network-device-name>
[945ccaa]731 - ip: 192.168.0.2
732 - gateway: 192.168.0.1
733 - prefix: 24
734 - DNS: 192.168.0.1
735 - Domain: <Your Domain Name>
736 and gateway comes before DNS. Change below if book changes -->
737 <xsl:choose>
[5af9ab4]738 <xsl:when test="contains($netstring,'&lt;network-device-name&gt;')">
[945ccaa]739 <xsl:call-template name="outputsysdnet">
740 <xsl:with-param name="netstring"
[5af9ab4]741 select="substring-before($netstring,'&lt;network-device-name&gt;')"/>
[945ccaa]742 </xsl:call-template>
743 <xsl:value-of select="$interface"/>
744 <xsl:call-template name="outputsysdnet">
745 <xsl:with-param name="netstring"
[5af9ab4]746 select="substring-after($netstring,'&lt;network-device-name&gt;')"/>
[945ccaa]747 </xsl:call-template>
748 </xsl:when>
749 <xsl:when test="contains($netstring,'192.168.0.1') and
750 contains($netstring,'Gateway')">
751 <xsl:call-template name="outputsysdnet">
752 <xsl:with-param name="netstring"
753 select="substring-before($netstring,'192.168.0.1')"/>
754 </xsl:call-template>
755 <xsl:value-of select="$gateway"/>
756 <xsl:call-template name="outputsysdnet">
757 <xsl:with-param name="netstring"
758 select="substring-after($netstring,'192.168.0.1')"/>
759 </xsl:call-template>
760 </xsl:when>
761 <xsl:when test="contains($netstring,'192.168.0.1') and
762 not(contains($netstring,'Gateway'))">
763 <xsl:call-template name="outputsysdnet">
764 <xsl:with-param name="netstring"
765 select="substring-before($netstring,'192.168.0.1')"/>
766 </xsl:call-template>
767 <xsl:value-of select="$nameserver1"/>
768 <xsl:text>
769DNS=</xsl:text>
770 <xsl:value-of select="$nameserver2"/>
771 <xsl:call-template name="outputsysdnet">
772 <xsl:with-param name="netstring"
773 select="substring-after($netstring,'192.168.0.1')"/>
774 </xsl:call-template>
775 </xsl:when>
776 <xsl:when test="contains($netstring,'192.168.0.2')">
777 <xsl:call-template name="outputsysdnet">
778 <xsl:with-param name="netstring"
779 select="substring-before($netstring,'192.168.0.2')"/>
780 </xsl:call-template>
781 <xsl:value-of select="$ip"/>
782 <xsl:call-template name="outputsysdnet">
783 <xsl:with-param name="netstring"
784 select="substring-after($netstring,'192.168.0.2')"/>
785 </xsl:call-template>
786 </xsl:when>
787 <xsl:when test="contains($netstring,'24')">
788 <xsl:call-template name="outputsysdnet">
789 <xsl:with-param name="netstring"
790 select="substring-before($netstring,'24')"/>
791 </xsl:call-template>
792 <xsl:value-of select="$prefix"/>
793 <xsl:call-template name="outputsysdnet">
794 <xsl:with-param name="netstring"
795 select="substring-after($netstring,'24')"/>
796 </xsl:call-template>
797 </xsl:when>
798 <xsl:when test="contains($netstring,'&lt;Your Domain Name&gt;')">
799 <xsl:call-template name="outputsysdnet">
800 <xsl:with-param name="netstring"
801 select="substring-before($netstring,'&lt;Your Domain Name&gt;')"/>
802 </xsl:call-template>
803 <xsl:value-of select="$domain"/>
804 <xsl:call-template name="outputsysdnet">
805 <xsl:with-param name="netstring"
806 select="substring-after($netstring,'&lt;Your Domain Name&gt;')"/>
807 </xsl:call-template>
808 </xsl:when>
809 <xsl:otherwise>
810 <xsl:value-of select="$netstring"/>
[3b43e17b]811 </xsl:otherwise>
812 </xsl:choose>
813 </xsl:template>
814
815 <xsl:template name="outputsysvconsole">
816 <!-- We suppose that book example has the following values:
817 - KEYMAP: bg_bds-utf8
818 - FONT: LatArCyrHeb-16
819 Change below if book changes -->
820 <xsl:param name="consolestring" select="''"/>
821 <xsl:choose>
822 <xsl:when test="contains($consolestring,'bg_bds-utf8')">
823 <xsl:call-template name="outputsysvconsole">
824 <xsl:with-param
825 name="consolestring"
826 select="substring-before($consolestring,'bg_bds-utf8')"/>
827 </xsl:call-template>
828 <xsl:value-of select="$keymap"/>
829 <xsl:call-template name="outputsysvconsole">
830 <xsl:with-param
831 name="consolestring"
832 select="substring-after($consolestring,'bg_bds-utf8')"/>
833 </xsl:call-template>
834 </xsl:when>
835 <xsl:when test="contains($consolestring,'LatArCyrHeb-16')">
836 <xsl:call-template name="outputsysvconsole">
837 <xsl:with-param
838 name="consolestring"
839 select="substring-before($consolestring,'LatArCyrHeb-16')"/>
840 </xsl:call-template>
841 <xsl:value-of select="$font"/>
842 <xsl:text>"
843LOG_LEVEL="</xsl:text>
844 <xsl:copy-of select="$log-level"/>
845 <xsl:call-template name="outputsysvconsole">
846 <xsl:with-param
847 name="consolestring"
848 select="substring-after($consolestring,'LatArCyrHeb-16')"/>
849 </xsl:call-template>
850 </xsl:when>
851 <xsl:otherwise>
852 <xsl:copy-of select="$consolestring"/>
853 </xsl:otherwise>
854 </xsl:choose>
855 </xsl:template>
856
857 <xsl:template name="outputsysdconsole">
858 <!-- We suppose that book example has the following values:
859 - KEYMAP: de-latin1
860 - FONT: Lat2-Terminus16
861 Change below if book changes -->
862 <xsl:param name="consolestring" select="''"/>
863 <xsl:choose>
864 <xsl:when test="contains($consolestring,'de-latin1')">
865 <xsl:call-template name="outputsysdconsole">
866 <xsl:with-param
867 name="consolestring"
868 select="substring-before($consolestring,'de-latin1')"/>
869 </xsl:call-template>
870 <xsl:value-of select="$keymap"/>
871 <xsl:call-template name="outputsysdconsole">
872 <xsl:with-param
873 name="consolestring"
874 select="substring-after($consolestring,'de-latin1')"/>
875 </xsl:call-template>
876 </xsl:when>
877 <xsl:when test="contains($consolestring,'Lat2-Terminus16')">
878 <xsl:call-template name="outputsysdconsole">
879 <xsl:with-param
880 name="consolestring"
881 select="substring-before($consolestring,'Lat2-Terminus16')"/>
882 </xsl:call-template>
883 <xsl:value-of select="$font"/>
884 <xsl:call-template name="outputsysdconsole">
885 <xsl:with-param
886 name="consolestring"
887 select="substring-after($consolestring,'Lat2-Terminus16')"/>
888 </xsl:call-template>
889 </xsl:when>
890 <xsl:otherwise>
891 <xsl:copy-of select="$consolestring"/>
[945ccaa]892 </xsl:otherwise>
893 </xsl:choose>
894 </xsl:template>
895
[7072e1f]896 <xsl:template name="outputpkgdest">
897 <xsl:param name="outputstring" select="foo"/>
898 <xsl:choose>
899 <xsl:when test="contains($outputstring,'make ')">
900 <xsl:choose>
901 <xsl:when test="not(starts-with($outputstring,'make'))">
902 <xsl:call-template name="outputpkgdest">
903 <xsl:with-param name="outputstring"
904 select="substring-before($outputstring,'make')"/>
905 </xsl:call-template>
906 <xsl:call-template name="outputpkgdest">
907 <xsl:with-param
908 name="outputstring"
909 select="substring-after($outputstring,
910 substring-before($outputstring,'make'))"/>
911 </xsl:call-template>
912 </xsl:when>
913 <xsl:otherwise>
914 <xsl:choose>
915<!-- special cases (no DESTDIR) here -->
916 <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
917 <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
918 <xsl:value-of
919 select="substring-before(substring-after(string(),'make'),
920 'install')"/>
921 <xsl:text>install&#xA;</xsl:text>
922 </xsl:when>
923 <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
924 <xsl:text>make PREFIX=$PKG_DEST/usr install&#xA;</xsl:text>
925 </xsl:when>
926 <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
927 <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install&#xA;</xsl:text>
928 </xsl:when>
929 <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
[b1f4a8d]930 <xsl:text>make DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
[7072e1f]931 <xsl:value-of
[b1f4a8d]932 select="substring-before(substring-after(string(),'DOCDIR='),
[7072e1f]933 'install')"/>
934 <xsl:text>install&#xA;</xsl:text>
935 </xsl:when>
936 <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
937 <xsl:text>make ROOT=$PKG_DEST</xsl:text>
938 <xsl:value-of
939 select="substring-before(substring-after(string(),'make'),
940 'install')"/>
941 <xsl:text>install&#xA;</xsl:text>
942 </xsl:when>
943 <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
944 <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
945 <xsl:value-of
946 select="substring-before(substring-after(string(),'make'),
947 'install')"/>
948 <xsl:text>install&#xA;</xsl:text>
949 </xsl:when>
[560bef1]950 <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
951 <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
952 <xsl:call-template name="outputpkgdest">
953 <xsl:with-param name="outputstring"
954 select="substring-after($outputstring,'make')"/>
955 </xsl:call-template>
956 </xsl:when>
[7072e1f]957 <xsl:otherwise>
[560bef1]958 <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
[e6e0c85]959 <xsl:call-template name="outputpkgdest">
[560bef1]960 <xsl:with-param
[7072e1f]961 name="outputstring"
962 select="substring-after($outputstring,'make')"/>
[560bef1]963 </xsl:call-template>
[7072e1f]964 </xsl:otherwise>
965 </xsl:choose>
966 </xsl:otherwise>
967 </xsl:choose>
968 </xsl:when>
[1cb4c76]969 <xsl:when test="contains($outputstring,'ninja install')">
[4696ddd]970 <xsl:choose>
[1cb4c76]971 <xsl:when test="not(starts-with($outputstring,'ninja install'))">
[4696ddd]972 <xsl:call-template name="outputpkgdest">
973 <xsl:with-param name="outputstring"
[1cb4c76]974 select="substring-before($outputstring,'ninja install')"/>
[4696ddd]975 </xsl:call-template>
976 <xsl:call-template name="outputpkgdest">
977 <xsl:with-param
978 name="outputstring"
979 select="substring-after($outputstring,
[1cb4c76]980 substring-before($outputstring,'ninja install'))"/>
[4696ddd]981 </xsl:call-template>
982 </xsl:when>
[1cb4c76]983 <xsl:otherwise> <!-- "ninja" is the first word and is followed by
984 "install"-->
[4696ddd]985 <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
986 <xsl:call-template name="outputpkgdest">
987 <xsl:with-param
988 name="outputstring"
989 select="substring-after($outputstring,'ninja')"/>
990 </xsl:call-template>
991 </xsl:otherwise>
992 </xsl:choose>
993 </xsl:when>
994 <xsl:otherwise> <!-- no make nor ninja in this string -->
[7072e1f]995 <xsl:choose>
996 <xsl:when test="contains($outputstring,'&gt;/') and
997 not(contains(substring-before($outputstring,'&gt;/'),' /'))">
998 <xsl:value-of select="substring-before($outputstring,'&gt;/')"/>
999 <xsl:text>&gt;$PKG_DEST/</xsl:text>
1000 <xsl:call-template name="outputpkgdest">
1001 <xsl:with-param name="outputstring" select="substring-after($outputstring,'&gt;/')"/>
1002 </xsl:call-template>
1003 </xsl:when>
1004 <xsl:when test="contains($outputstring,' /')">
1005 <xsl:value-of select="substring-before($outputstring,' /')"/>
1006 <xsl:text> $PKG_DEST/</xsl:text>
1007 <xsl:call-template name="outputpkgdest">
1008 <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
1009 </xsl:call-template>
1010 </xsl:when>
1011 <xsl:otherwise>
1012 <xsl:value-of select="$outputstring"/>
1013 </xsl:otherwise>
1014 </xsl:choose>
1015 </xsl:otherwise>
1016 </xsl:choose>
1017 </xsl:template>
[945ccaa]1018
1019 <xsl:variable name="APOS">'</xsl:variable>
1020 <xsl:template name="output-wrap">
1021 <xsl:param name="commands" select="''"/>
1022 <xsl:choose>
1023 <xsl:when test="contains($commands,string($APOS))">
1024 <xsl:call-template name="output-wrap">
1025 <xsl:with-param name="commands"
1026 select="substring-before($commands,string($APOS))"/>
1027 </xsl:call-template>
1028 <xsl:text>'\''</xsl:text>
1029 <xsl:call-template name="output-wrap">
1030 <xsl:with-param name="commands"
1031 select="substring-after($commands,string($APOS))"/>
1032 </xsl:call-template>
1033 </xsl:when>
1034 <xsl:otherwise>
1035 <xsl:value-of select="$commands"/>
1036 </xsl:otherwise>
1037 </xsl:choose>
1038 </xsl:template>
1039
[dc7fd7b]1040 <xsl:template name="comment-strip">
1041 <xsl:param name="instructions" select="''"/>
1042 <xsl:choose>
1043 <xsl:when test="contains($instructions,'&#xA;')">
1044 <xsl:call-template name="comment-strip">
1045 <xsl:with-param name="instructions"
1046 select="substring-before($instructions,'&#xA;')"/>
1047 </xsl:call-template>
1048 <xsl:call-template name="comment-strip">
1049 <xsl:with-param name="instructions"
1050 select="substring-after($instructions,'&#xA;')"/>
1051 </xsl:call-template>
1052 </xsl:when>
1053 <xsl:when test="contains($instructions,'\*.la')">
1054 <xsl:if test="$del-la-files='n'">
1055 <xsl:text># </xsl:text>
1056 </xsl:if>
1057 <xsl:value-of select="$instructions"/>
1058 <xsl:text>&#xA;</xsl:text>
1059 </xsl:when>
1060 <xsl:when test="contains($instructions,'strip ')">
1061 <xsl:if test="$strip='n'">
1062 <xsl:text># </xsl:text>
1063 </xsl:if>
1064 <xsl:value-of select="$instructions"/>
1065 <xsl:text> || true&#xA;</xsl:text>
1066 </xsl:when>
1067 <xsl:otherwise>
1068 <xsl:value-of select="$instructions"/>
1069 <xsl:text>&#xA;</xsl:text>
1070 </xsl:otherwise>
1071 </xsl:choose>
1072 </xsl:template>
1073
[5a8939e]1074 <xsl:template name="comment-test">
1075 <xsl:param name="instructions" select="''"/>
1076 <xsl:choose>
1077 <xsl:when test="contains($instructions,'&#xA;')">
1078 <xsl:call-template name="comment-test">
1079 <xsl:with-param name="instructions"
1080 select="substring-before($instructions,'&#xA;')"/>
1081 </xsl:call-template>
1082 <xsl:call-template name="comment-test">
1083 <xsl:with-param name="instructions"
1084 select="substring-after($instructions,'&#xA;')"/>
1085 </xsl:call-template>
1086 </xsl:when>
1087 <xsl:otherwise>
1088 <xsl:if test="$testsuite = '0' or
1089 $testsuite = '1' and
1090 not(ancestor::sect1[@id='ch-system-gcc']) and
1091 not(ancestor::sect1[@id='ch-system-glibc']) and
1092 not(ancestor::sect1[@id='ch-system-gmp']) and
1093 not(ancestor::sect1[@id='ch-system-mpfr']) and
1094 not(ancestor::sect1[@id='ch-system-binutils']) or
1095 $testsuite = '2' and
1096 ancestor::chapter[@id='chapter-temporary-tools']">
1097 <xsl:text># </xsl:text>
1098 </xsl:if>
1099 <xsl:choose>
1100 <xsl:when test="$bomb-testsuite = 'n'">
1101 <xsl:choose>
1102 <xsl:when test="contains(string(), 'make -k')">
1103 <xsl:value-of select="$instructions"/>
1104 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1105 </xsl:when>
1106 <xsl:when test="contains($instructions, 'make')">
1107 <xsl:value-of select="substring-before($instructions, 'make')"/>
1108 <xsl:text>make -k</xsl:text>
1109 <xsl:value-of select="substring-after($instructions, 'make')"/>
1110 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1111 </xsl:when>
1112 <xsl:otherwise>
1113 <xsl:value-of select="$instructions"/>
[764a5d7]1114 <xsl:if
1115 test="not(contains($instructions, '&gt;&gt;')) and
1116 substring($instructions,
1117 string-length($instructions)) != '\'">
[5a8939e]1118 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
1119 </xsl:if>
1120 <xsl:text>&#xA;</xsl:text>
1121 </xsl:otherwise>
1122 </xsl:choose>
1123 </xsl:when>
1124 <xsl:otherwise>
1125 <!-- bomb-testsuite != 'n'-->
1126 <xsl:choose>
1127 <xsl:when test="contains($instructions, 'make -k')">
1128 <xsl:value-of select="$instructions"/>
1129 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1130 </xsl:when>
1131 <xsl:otherwise>
1132 <xsl:value-of select="$instructions"/>
[764a5d7]1133 <xsl:if test="not(contains($instructions, '&gt;&gt;')) and
1134 substring($instructions,
1135 string-length($instructions)) != '\'">
[5a8939e]1136 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
1137 </xsl:if>
1138 <xsl:text>&#xA;</xsl:text>
1139 </xsl:otherwise>
1140 </xsl:choose>
1141 </xsl:otherwise> <!-- end not bomb-test=n -->
1142 </xsl:choose>
1143 </xsl:otherwise>
1144 </xsl:choose>
1145 </xsl:template>
1146
[557fe91]1147</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.