source: LFS/lfs.xsl@ 3b43e17b

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

Generate console files:

  • add variables LOCAL (y is hw clock set to local time) and LOG_LEVEL (sysv)
  • generate /etc/sysconfig/console (sysv) or /etc/vconsole.conf (systemd)
  • generate /etc/adjtime (only systemd)
  • remove UNICODE and FONTMAP variables (jhalfs makes unicode default)
  • Property mode set to 100644
File size: 45.8 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>
591<!-- Only adapted to LFS-20170310 and later -->
592 <xsl:when test="contains(string(.),'HOSTNAME')">
593 <xsl:value-of select="$hostname"/>
594 </xsl:when>
595 <xsl:when test="contains(string(.),'FQDN')">
596 <xsl:value-of select="$hostname"/>
597 <xsl:text>.</xsl:text>
598 <xsl:value-of select="$domain"/>
599 </xsl:when>
600 <xsl:when test="contains(string(.),'alias')"/>
601 <xsl:when test="contains(string(.),'&lt;lfs&gt;')">
602 <xsl:value-of select="$hostname"/>
603 </xsl:when>
[a41ce58]604 <xsl:otherwise>
605 <xsl:text>**EDITME</xsl:text>
606 <xsl:apply-templates/>
607 <xsl:text>EDITME**</xsl:text>
608 </xsl:otherwise>
609 </xsl:choose>
[557fe91]610 </xsl:template>
[2e1c1c3]611
[945ccaa]612 <xsl:template match="literal">
613 <xsl:choose>
614 <xsl:when test="contains(string(),'ONBOOT')">
615 <xsl:call-template name="outputnet">
616 <xsl:with-param name="netstring" select="string()"/>
617 </xsl:call-template>
618 </xsl:when>
619 <xsl:when test="contains(string(),'[Match]')">
620 <xsl:call-template name="outputsysdnet">
621 <xsl:with-param name="netstring" select="string()"/>
622 </xsl:call-template>
623 </xsl:when>
[3b43e17b]624 <xsl:when test="contains(string(),'0.0 0 0.0')">
625 <xsl:copy-of select="substring-before(string(),'LOCAL')"/>
626 <xsl:if test="$local='y'"><xsl:text>LOCAL</xsl:text></xsl:if>
627 <xsl:if test="$local='n'"><xsl:text>UTC</xsl:text></xsl:if>
628 </xsl:when>
629 <xsl:when test="contains(string(),'UTC=1')">
630 <xsl:copy-of select="substring-before(string(),'1')"/>
631 <xsl:if test="$local='y'"><xsl:text>0</xsl:text></xsl:if>
632 <xsl:if test="$local='n'"><xsl:text>1</xsl:text></xsl:if>
633 <xsl:copy-of select="substring-after(string(),'1')"/>
634 </xsl:when>
635 <xsl:when test="contains(string(),'bg_bds-')">
636 <xsl:call-template name="outputsysvconsole">
637 <xsl:with-param name="consolestring" select="string()"/>
638 </xsl:call-template>
639 </xsl:when>
640 <xsl:when test="contains(string(),'de-latin1')">
641 <xsl:call-template name="outputsysdconsole">
642 <xsl:with-param name="consolestring" select="string()"/>
643 </xsl:call-template>
644 </xsl:when>
[945ccaa]645 <xsl:otherwise>
646 <xsl:apply-templates/>
647 </xsl:otherwise>
648 </xsl:choose>
649 </xsl:template>
650
651 <xsl:template name="outputnet">
652 <xsl:param name="netstring" select="''"/>
653 <!-- We suppose that book example has the following values:
654 - interface: eth0
655 - ip: 192.168.1.2
656 - gateway: 192.168.1.1
657 - prefix: 24
658 - broadcast: 192.168.1.255
659 Change below if book changes -->
660 <xsl:choose>
661 <xsl:when test="contains($netstring,'eth0')">
662 <xsl:call-template name="outputnet">
663 <xsl:with-param name="netstring"
664 select="substring-before($netstring,'eth0')"/>
665 </xsl:call-template>
666 <xsl:value-of select="$interface"/>
667 <xsl:call-template name="outputnet">
668 <xsl:with-param name="netstring"
669 select="substring-after($netstring,'eth0')"/>
670 </xsl:call-template>
671 </xsl:when>
672 <xsl:when test="contains($netstring,'192.168.1.1')">
673 <xsl:call-template name="outputnet">
674 <xsl:with-param name="netstring"
675 select="substring-before($netstring,'192.168.1.1')"/>
676 </xsl:call-template>
677 <xsl:value-of select="$gateway"/>
678 <xsl:call-template name="outputnet">
679 <xsl:with-param name="netstring"
680 select="substring-after($netstring,'192.168.1.1')"/>
681 </xsl:call-template>
682 </xsl:when>
683 <!-- must test this before the following, because 192.168.1.255 contains
684 192.168.1.2! -->
685 <xsl:when test="contains($netstring,'192.168.1.255')">
686 <xsl:call-template name="outputnet">
687 <xsl:with-param name="netstring"
688 select="substring-before($netstring,'192.168.1.255')"/>
689 </xsl:call-template>
690 <xsl:value-of select="$broadcast"/>
691 <xsl:call-template name="outputnet">
692 <xsl:with-param name="netstring"
693 select="substring-after($netstring,'192.168.1.255')"/>
694 </xsl:call-template>
695 </xsl:when>
696 <xsl:when test="contains($netstring,'192.168.1.2')">
697 <xsl:call-template name="outputnet">
698 <xsl:with-param name="netstring"
699 select="substring-before($netstring,'192.168.1.2')"/>
700 </xsl:call-template>
701 <xsl:value-of select="$ip"/>
702 <xsl:call-template name="outputnet">
703 <xsl:with-param name="netstring"
704 select="substring-after($netstring,'192.168.1.2')"/>
705 </xsl:call-template>
706 </xsl:when>
707 <xsl:when test="contains($netstring,'24')">
708 <xsl:call-template name="outputnet">
709 <xsl:with-param name="netstring"
710 select="substring-before($netstring,'24')"/>
711 </xsl:call-template>
712 <xsl:value-of select="$prefix"/>
713 <xsl:call-template name="outputnet">
714 <xsl:with-param name="netstring"
715 select="substring-after($netstring,'24')"/>
716 </xsl:call-template>
717 </xsl:when>
718 <xsl:otherwise>
719 <xsl:value-of select="$netstring"/>
720 </xsl:otherwise>
721 </xsl:choose>
722 </xsl:template>
723
724 <xsl:template name="outputsysdnet">
725 <xsl:param name="netstring" select="''"/>
726 <!-- We suppose that book example has the following values:
[5af9ab4]727 - interface: <network-device-name>
[945ccaa]728 - ip: 192.168.0.2
729 - gateway: 192.168.0.1
730 - prefix: 24
731 - DNS: 192.168.0.1
732 - Domain: <Your Domain Name>
733 and gateway comes before DNS. Change below if book changes -->
734 <xsl:choose>
[5af9ab4]735 <xsl:when test="contains($netstring,'&lt;network-device-name&gt;')">
[945ccaa]736 <xsl:call-template name="outputsysdnet">
737 <xsl:with-param name="netstring"
[5af9ab4]738 select="substring-before($netstring,'&lt;network-device-name&gt;')"/>
[945ccaa]739 </xsl:call-template>
740 <xsl:value-of select="$interface"/>
741 <xsl:call-template name="outputsysdnet">
742 <xsl:with-param name="netstring"
[5af9ab4]743 select="substring-after($netstring,'&lt;network-device-name&gt;')"/>
[945ccaa]744 </xsl:call-template>
745 </xsl:when>
746 <xsl:when test="contains($netstring,'192.168.0.1') and
747 contains($netstring,'Gateway')">
748 <xsl:call-template name="outputsysdnet">
749 <xsl:with-param name="netstring"
750 select="substring-before($netstring,'192.168.0.1')"/>
751 </xsl:call-template>
752 <xsl:value-of select="$gateway"/>
753 <xsl:call-template name="outputsysdnet">
754 <xsl:with-param name="netstring"
755 select="substring-after($netstring,'192.168.0.1')"/>
756 </xsl:call-template>
757 </xsl:when>
758 <xsl:when test="contains($netstring,'192.168.0.1') and
759 not(contains($netstring,'Gateway'))">
760 <xsl:call-template name="outputsysdnet">
761 <xsl:with-param name="netstring"
762 select="substring-before($netstring,'192.168.0.1')"/>
763 </xsl:call-template>
764 <xsl:value-of select="$nameserver1"/>
765 <xsl:text>
766DNS=</xsl:text>
767 <xsl:value-of select="$nameserver2"/>
768 <xsl:call-template name="outputsysdnet">
769 <xsl:with-param name="netstring"
770 select="substring-after($netstring,'192.168.0.1')"/>
771 </xsl:call-template>
772 </xsl:when>
773 <xsl:when test="contains($netstring,'192.168.0.2')">
774 <xsl:call-template name="outputsysdnet">
775 <xsl:with-param name="netstring"
776 select="substring-before($netstring,'192.168.0.2')"/>
777 </xsl:call-template>
778 <xsl:value-of select="$ip"/>
779 <xsl:call-template name="outputsysdnet">
780 <xsl:with-param name="netstring"
781 select="substring-after($netstring,'192.168.0.2')"/>
782 </xsl:call-template>
783 </xsl:when>
784 <xsl:when test="contains($netstring,'24')">
785 <xsl:call-template name="outputsysdnet">
786 <xsl:with-param name="netstring"
787 select="substring-before($netstring,'24')"/>
788 </xsl:call-template>
789 <xsl:value-of select="$prefix"/>
790 <xsl:call-template name="outputsysdnet">
791 <xsl:with-param name="netstring"
792 select="substring-after($netstring,'24')"/>
793 </xsl:call-template>
794 </xsl:when>
795 <xsl:when test="contains($netstring,'&lt;Your Domain Name&gt;')">
796 <xsl:call-template name="outputsysdnet">
797 <xsl:with-param name="netstring"
798 select="substring-before($netstring,'&lt;Your Domain Name&gt;')"/>
799 </xsl:call-template>
800 <xsl:value-of select="$domain"/>
801 <xsl:call-template name="outputsysdnet">
802 <xsl:with-param name="netstring"
803 select="substring-after($netstring,'&lt;Your Domain Name&gt;')"/>
804 </xsl:call-template>
805 </xsl:when>
806 <xsl:otherwise>
807 <xsl:value-of select="$netstring"/>
[3b43e17b]808 </xsl:otherwise>
809 </xsl:choose>
810 </xsl:template>
811
812 <xsl:template name="outputsysvconsole">
813 <!-- We suppose that book example has the following values:
814 - KEYMAP: bg_bds-utf8
815 - FONT: LatArCyrHeb-16
816 Change below if book changes -->
817 <xsl:param name="consolestring" select="''"/>
818 <xsl:choose>
819 <xsl:when test="contains($consolestring,'bg_bds-utf8')">
820 <xsl:call-template name="outputsysvconsole">
821 <xsl:with-param
822 name="consolestring"
823 select="substring-before($consolestring,'bg_bds-utf8')"/>
824 </xsl:call-template>
825 <xsl:value-of select="$keymap"/>
826 <xsl:call-template name="outputsysvconsole">
827 <xsl:with-param
828 name="consolestring"
829 select="substring-after($consolestring,'bg_bds-utf8')"/>
830 </xsl:call-template>
831 </xsl:when>
832 <xsl:when test="contains($consolestring,'LatArCyrHeb-16')">
833 <xsl:call-template name="outputsysvconsole">
834 <xsl:with-param
835 name="consolestring"
836 select="substring-before($consolestring,'LatArCyrHeb-16')"/>
837 </xsl:call-template>
838 <xsl:value-of select="$font"/>
839 <xsl:text>"
840LOG_LEVEL="</xsl:text>
841 <xsl:copy-of select="$log-level"/>
842 <xsl:call-template name="outputsysvconsole">
843 <xsl:with-param
844 name="consolestring"
845 select="substring-after($consolestring,'LatArCyrHeb-16')"/>
846 </xsl:call-template>
847 </xsl:when>
848 <xsl:otherwise>
849 <xsl:copy-of select="$consolestring"/>
850 </xsl:otherwise>
851 </xsl:choose>
852 </xsl:template>
853
854 <xsl:template name="outputsysdconsole">
855 <!-- We suppose that book example has the following values:
856 - KEYMAP: de-latin1
857 - FONT: Lat2-Terminus16
858 Change below if book changes -->
859 <xsl:param name="consolestring" select="''"/>
860 <xsl:choose>
861 <xsl:when test="contains($consolestring,'de-latin1')">
862 <xsl:call-template name="outputsysdconsole">
863 <xsl:with-param
864 name="consolestring"
865 select="substring-before($consolestring,'de-latin1')"/>
866 </xsl:call-template>
867 <xsl:value-of select="$keymap"/>
868 <xsl:call-template name="outputsysdconsole">
869 <xsl:with-param
870 name="consolestring"
871 select="substring-after($consolestring,'de-latin1')"/>
872 </xsl:call-template>
873 </xsl:when>
874 <xsl:when test="contains($consolestring,'Lat2-Terminus16')">
875 <xsl:call-template name="outputsysdconsole">
876 <xsl:with-param
877 name="consolestring"
878 select="substring-before($consolestring,'Lat2-Terminus16')"/>
879 </xsl:call-template>
880 <xsl:value-of select="$font"/>
881 <xsl:call-template name="outputsysdconsole">
882 <xsl:with-param
883 name="consolestring"
884 select="substring-after($consolestring,'Lat2-Terminus16')"/>
885 </xsl:call-template>
886 </xsl:when>
887 <xsl:otherwise>
888 <xsl:copy-of select="$consolestring"/>
[945ccaa]889 </xsl:otherwise>
890 </xsl:choose>
891 </xsl:template>
892
[7072e1f]893 <xsl:template name="outputpkgdest">
894 <xsl:param name="outputstring" select="foo"/>
895 <xsl:choose>
896 <xsl:when test="contains($outputstring,'make ')">
897 <xsl:choose>
898 <xsl:when test="not(starts-with($outputstring,'make'))">
899 <xsl:call-template name="outputpkgdest">
900 <xsl:with-param name="outputstring"
901 select="substring-before($outputstring,'make')"/>
902 </xsl:call-template>
903 <xsl:call-template name="outputpkgdest">
904 <xsl:with-param
905 name="outputstring"
906 select="substring-after($outputstring,
907 substring-before($outputstring,'make'))"/>
908 </xsl:call-template>
909 </xsl:when>
910 <xsl:otherwise>
911 <xsl:choose>
912<!-- special cases (no DESTDIR) here -->
913 <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
914 <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
915 <xsl:value-of
916 select="substring-before(substring-after(string(),'make'),
917 'install')"/>
918 <xsl:text>install&#xA;</xsl:text>
919 </xsl:when>
920 <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
921 <xsl:text>make PREFIX=$PKG_DEST/usr install&#xA;</xsl:text>
922 </xsl:when>
923 <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
924 <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install&#xA;</xsl:text>
925 </xsl:when>
926 <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
[b1f4a8d]927 <xsl:text>make DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
[7072e1f]928 <xsl:value-of
[b1f4a8d]929 select="substring-before(substring-after(string(),'DOCDIR='),
[7072e1f]930 'install')"/>
931 <xsl:text>install&#xA;</xsl:text>
932 </xsl:when>
933 <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
934 <xsl:text>make ROOT=$PKG_DEST</xsl:text>
935 <xsl:value-of
936 select="substring-before(substring-after(string(),'make'),
937 'install')"/>
938 <xsl:text>install&#xA;</xsl:text>
939 </xsl:when>
940 <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
941 <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
942 <xsl:value-of
943 select="substring-before(substring-after(string(),'make'),
944 'install')"/>
945 <xsl:text>install&#xA;</xsl:text>
946 </xsl:when>
[560bef1]947 <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
948 <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
949 <xsl:call-template name="outputpkgdest">
950 <xsl:with-param name="outputstring"
951 select="substring-after($outputstring,'make')"/>
952 </xsl:call-template>
953 </xsl:when>
[7072e1f]954 <xsl:otherwise>
[560bef1]955 <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
[e6e0c85]956 <xsl:call-template name="outputpkgdest">
[560bef1]957 <xsl:with-param
[7072e1f]958 name="outputstring"
959 select="substring-after($outputstring,'make')"/>
[560bef1]960 </xsl:call-template>
[7072e1f]961 </xsl:otherwise>
962 </xsl:choose>
963 </xsl:otherwise>
964 </xsl:choose>
965 </xsl:when>
[1cb4c76]966 <xsl:when test="contains($outputstring,'ninja install')">
[4696ddd]967 <xsl:choose>
[1cb4c76]968 <xsl:when test="not(starts-with($outputstring,'ninja install'))">
[4696ddd]969 <xsl:call-template name="outputpkgdest">
970 <xsl:with-param name="outputstring"
[1cb4c76]971 select="substring-before($outputstring,'ninja install')"/>
[4696ddd]972 </xsl:call-template>
973 <xsl:call-template name="outputpkgdest">
974 <xsl:with-param
975 name="outputstring"
976 select="substring-after($outputstring,
[1cb4c76]977 substring-before($outputstring,'ninja install'))"/>
[4696ddd]978 </xsl:call-template>
979 </xsl:when>
[1cb4c76]980 <xsl:otherwise> <!-- "ninja" is the first word and is followed by
981 "install"-->
[4696ddd]982 <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
983 <xsl:call-template name="outputpkgdest">
984 <xsl:with-param
985 name="outputstring"
986 select="substring-after($outputstring,'ninja')"/>
987 </xsl:call-template>
988 </xsl:otherwise>
989 </xsl:choose>
990 </xsl:when>
991 <xsl:otherwise> <!-- no make nor ninja in this string -->
[7072e1f]992 <xsl:choose>
993 <xsl:when test="contains($outputstring,'&gt;/') and
994 not(contains(substring-before($outputstring,'&gt;/'),' /'))">
995 <xsl:value-of select="substring-before($outputstring,'&gt;/')"/>
996 <xsl:text>&gt;$PKG_DEST/</xsl:text>
997 <xsl:call-template name="outputpkgdest">
998 <xsl:with-param name="outputstring" select="substring-after($outputstring,'&gt;/')"/>
999 </xsl:call-template>
1000 </xsl:when>
1001 <xsl:when test="contains($outputstring,' /')">
1002 <xsl:value-of select="substring-before($outputstring,' /')"/>
1003 <xsl:text> $PKG_DEST/</xsl:text>
1004 <xsl:call-template name="outputpkgdest">
1005 <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
1006 </xsl:call-template>
1007 </xsl:when>
1008 <xsl:otherwise>
1009 <xsl:value-of select="$outputstring"/>
1010 </xsl:otherwise>
1011 </xsl:choose>
1012 </xsl:otherwise>
1013 </xsl:choose>
1014 </xsl:template>
[945ccaa]1015
1016 <xsl:variable name="APOS">'</xsl:variable>
1017 <xsl:template name="output-wrap">
1018 <xsl:param name="commands" select="''"/>
1019 <xsl:choose>
1020 <xsl:when test="contains($commands,string($APOS))">
1021 <xsl:call-template name="output-wrap">
1022 <xsl:with-param name="commands"
1023 select="substring-before($commands,string($APOS))"/>
1024 </xsl:call-template>
1025 <xsl:text>'\''</xsl:text>
1026 <xsl:call-template name="output-wrap">
1027 <xsl:with-param name="commands"
1028 select="substring-after($commands,string($APOS))"/>
1029 </xsl:call-template>
1030 </xsl:when>
1031 <xsl:otherwise>
1032 <xsl:value-of select="$commands"/>
1033 </xsl:otherwise>
1034 </xsl:choose>
1035 </xsl:template>
1036
[dc7fd7b]1037 <xsl:template name="comment-strip">
1038 <xsl:param name="instructions" select="''"/>
1039 <xsl:choose>
1040 <xsl:when test="contains($instructions,'&#xA;')">
1041 <xsl:call-template name="comment-strip">
1042 <xsl:with-param name="instructions"
1043 select="substring-before($instructions,'&#xA;')"/>
1044 </xsl:call-template>
1045 <xsl:call-template name="comment-strip">
1046 <xsl:with-param name="instructions"
1047 select="substring-after($instructions,'&#xA;')"/>
1048 </xsl:call-template>
1049 </xsl:when>
1050 <xsl:when test="contains($instructions,'\*.la')">
1051 <xsl:if test="$del-la-files='n'">
1052 <xsl:text># </xsl:text>
1053 </xsl:if>
1054 <xsl:value-of select="$instructions"/>
1055 <xsl:text>&#xA;</xsl:text>
1056 </xsl:when>
1057 <xsl:when test="contains($instructions,'strip ')">
1058 <xsl:if test="$strip='n'">
1059 <xsl:text># </xsl:text>
1060 </xsl:if>
1061 <xsl:value-of select="$instructions"/>
1062 <xsl:text> || true&#xA;</xsl:text>
1063 </xsl:when>
1064 <xsl:otherwise>
1065 <xsl:value-of select="$instructions"/>
1066 <xsl:text>&#xA;</xsl:text>
1067 </xsl:otherwise>
1068 </xsl:choose>
1069 </xsl:template>
1070
[5a8939e]1071 <xsl:template name="comment-test">
1072 <xsl:param name="instructions" select="''"/>
1073 <xsl:choose>
1074 <xsl:when test="contains($instructions,'&#xA;')">
1075 <xsl:call-template name="comment-test">
1076 <xsl:with-param name="instructions"
1077 select="substring-before($instructions,'&#xA;')"/>
1078 </xsl:call-template>
1079 <xsl:call-template name="comment-test">
1080 <xsl:with-param name="instructions"
1081 select="substring-after($instructions,'&#xA;')"/>
1082 </xsl:call-template>
1083 </xsl:when>
1084 <xsl:otherwise>
1085 <xsl:if test="$testsuite = '0' or
1086 $testsuite = '1' and
1087 not(ancestor::sect1[@id='ch-system-gcc']) and
1088 not(ancestor::sect1[@id='ch-system-glibc']) and
1089 not(ancestor::sect1[@id='ch-system-gmp']) and
1090 not(ancestor::sect1[@id='ch-system-mpfr']) and
1091 not(ancestor::sect1[@id='ch-system-binutils']) or
1092 $testsuite = '2' and
1093 ancestor::chapter[@id='chapter-temporary-tools']">
1094 <xsl:text># </xsl:text>
1095 </xsl:if>
1096 <xsl:choose>
1097 <xsl:when test="$bomb-testsuite = 'n'">
1098 <xsl:choose>
1099 <xsl:when test="contains(string(), 'make -k')">
1100 <xsl:value-of select="$instructions"/>
1101 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1102 </xsl:when>
1103 <xsl:when test="contains($instructions, 'make')">
1104 <xsl:value-of select="substring-before($instructions, 'make')"/>
1105 <xsl:text>make -k</xsl:text>
1106 <xsl:value-of select="substring-after($instructions, 'make')"/>
1107 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1108 </xsl:when>
1109 <xsl:otherwise>
1110 <xsl:value-of select="$instructions"/>
[764a5d7]1111 <xsl:if
1112 test="not(contains($instructions, '&gt;&gt;')) and
1113 substring($instructions,
1114 string-length($instructions)) != '\'">
[5a8939e]1115 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
1116 </xsl:if>
1117 <xsl:text>&#xA;</xsl:text>
1118 </xsl:otherwise>
1119 </xsl:choose>
1120 </xsl:when>
1121 <xsl:otherwise>
1122 <!-- bomb-testsuite != 'n'-->
1123 <xsl:choose>
1124 <xsl:when test="contains($instructions, 'make -k')">
1125 <xsl:value-of select="$instructions"/>
1126 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
1127 </xsl:when>
1128 <xsl:otherwise>
1129 <xsl:value-of select="$instructions"/>
[764a5d7]1130 <xsl:if test="not(contains($instructions, '&gt;&gt;')) and
1131 substring($instructions,
1132 string-length($instructions)) != '\'">
[5a8939e]1133 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
1134 </xsl:if>
1135 <xsl:text>&#xA;</xsl:text>
1136 </xsl:otherwise>
1137 </xsl:choose>
1138 </xsl:otherwise> <!-- end not bomb-test=n -->
1139 </xsl:choose>
1140 </xsl:otherwise>
1141 </xsl:choose>
1142 </xsl:template>
1143
[557fe91]1144</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.