1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 |
|
---|
3 | <!-- $Id$ -->
|
---|
4 |
|
---|
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">
|
---|
10 |
|
---|
11 | <!-- which revision attribute to include: can only be sysv or systemd,
|
---|
12 | but we leave checking to the caller-->
|
---|
13 | <xsl:param name="revision" select="'sysv'"/>
|
---|
14 |
|
---|
15 | <!-- use package management ?
|
---|
16 | n = no, original behavior
|
---|
17 | y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
---|
18 | -->
|
---|
19 | <xsl:param name="pkgmngt" select="'n'"/>
|
---|
20 |
|
---|
21 | <!-- Run test suites?
|
---|
22 | 0 = none
|
---|
23 | 1 = only chapter06 Glibc, GCC and Binutils testsuites
|
---|
24 | 2 = all chapter06 testsuites
|
---|
25 | 3 = all chapter05 and chapter06 testsuites
|
---|
26 | -->
|
---|
27 | <xsl:param name="testsuite" select="'1'"/>
|
---|
28 |
|
---|
29 | <!-- Bomb on test suites failures?
|
---|
30 | n = no, I want to build the full system and review the logs
|
---|
31 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
32 | -->
|
---|
33 | <xsl:param name="bomb-testsuite" select="'n'"/>
|
---|
34 |
|
---|
35 | <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
---|
36 | <xsl:param name="vim-lang" select="'n'"/>
|
---|
37 |
|
---|
38 | <!-- Time zone -->
|
---|
39 | <xsl:param name="timezone" select="'GMT'"/>
|
---|
40 |
|
---|
41 | <!-- Page size -->
|
---|
42 | <xsl:param name="page" select="'letter'"/>
|
---|
43 |
|
---|
44 | <!-- Locale settings -->
|
---|
45 | <xsl:param name="lang" select="'C'"/>
|
---|
46 |
|
---|
47 | <!-- Install the whole set of locales -->
|
---|
48 | <xsl:param name="full-locale" select="'n'"/>
|
---|
49 |
|
---|
50 | <xsl:template match="/">
|
---|
51 | <xsl:apply-templates select="//sect1[not(@revision) or
|
---|
52 | @revision=$revision]"/>
|
---|
53 | </xsl:template>
|
---|
54 |
|
---|
55 | <xsl:template match="sect1">
|
---|
56 | <!-- Since this xsl:if tag encloses the whole template, it would
|
---|
57 | be much better to transpose this condition to the select part
|
---|
58 | of the "calling" apply-template. But that would change the numbering,
|
---|
59 | so that it would be difficult to compare to previous versions. So for
|
---|
60 | version 2.4, let us keep this -->
|
---|
61 | <xsl:if test="(../@id='chapter-temporary-tools' or
|
---|
62 | ../@id='chapter-building-system' or
|
---|
63 | ../@id='chapter-bootscripts' or
|
---|
64 | ../@id='chapter-bootable') and
|
---|
65 | (sect2[not(@revision) or @revision=$revision]//..|.)/
|
---|
66 | screen[(not(@role) or @role != 'nodump') and
|
---|
67 | (not(@revision) or @revision=$revision)]/
|
---|
68 | userinput[not(starts-with(string(),'chroot'))]">
|
---|
69 | <!-- The last condition is a hack to allow previous versions of the
|
---|
70 | book where the chroot commands did not have role="nodump".
|
---|
71 | It only works if the chroot command is the only one on the page -->
|
---|
72 | <!-- The dirs names -->
|
---|
73 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
74 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
75 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
76 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
77 | <!-- The file names -->
|
---|
78 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
79 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
80 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
81 | <!-- The build order -->
|
---|
82 | <xsl:variable name="position" select="position()"/>
|
---|
83 | <xsl:variable name="order">
|
---|
84 | <xsl:choose>
|
---|
85 | <xsl:when test="string-length($position) = 1">
|
---|
86 | <xsl:text>00</xsl:text>
|
---|
87 | <xsl:value-of select="$position"/>
|
---|
88 | </xsl:when>
|
---|
89 | <xsl:when test="string-length($position) = 2">
|
---|
90 | <xsl:text>0</xsl:text>
|
---|
91 | <xsl:value-of select="$position"/>
|
---|
92 | </xsl:when>
|
---|
93 | <xsl:otherwise>
|
---|
94 | <xsl:value-of select="$position"/>
|
---|
95 | </xsl:otherwise>
|
---|
96 | </xsl:choose>
|
---|
97 | </xsl:variable>
|
---|
98 | <!-- Inclusion of package manager scriptlets -->
|
---|
99 | <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
---|
100 | <xsl:apply-templates
|
---|
101 | select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
|
---|
102 | mode="pkgmngt">
|
---|
103 | <xsl:with-param name="order" select="$order"/>
|
---|
104 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
105 | </xsl:apply-templates>
|
---|
106 | </xsl:if>
|
---|
107 | <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
---|
108 | <xsl:apply-templates
|
---|
109 | select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
|
---|
110 | mode="pkgmngt">
|
---|
111 | <xsl:with-param name="order" select="$order"/>
|
---|
112 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
113 | </xsl:apply-templates>
|
---|
114 | </xsl:if>
|
---|
115 | <!-- Creating dirs and files -->
|
---|
116 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
117 | <xsl:choose>
|
---|
118 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
119 | @id='ch-system-createfiles' or
|
---|
120 | @id='ch-system-strippingagain'">
|
---|
121 | <xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
---|
122 | </xsl:when>
|
---|
123 | <xsl:otherwise>
|
---|
124 | <xsl:text>#!/bin/bash
set +h
</xsl:text>
|
---|
125 | </xsl:otherwise>
|
---|
126 | </xsl:choose>
|
---|
127 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
128 | not(@id='ch-system-strippingagain')">
|
---|
129 | <xsl:text>set -e
</xsl:text>
|
---|
130 | </xsl:if>
|
---|
131 | <xsl:text>
</xsl:text>
|
---|
132 | <xsl:if test="sect2[@role='installation']">
|
---|
133 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
134 | </xsl:if>
|
---|
135 | <xsl:apply-templates select="sect2[not(@revision) or
|
---|
136 | @revision=$revision] |
|
---|
137 | screen[(not(@role) or
|
---|
138 | @role!='nodump') and
|
---|
139 | (not(@revision) or
|
---|
140 | @revision=$revision)]/userinput"/>
|
---|
141 | <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
|
---|
142 | <xsl:apply-templates
|
---|
143 | select="document('packageManager.xml')//sect1[
|
---|
144 | @id='ch-pkgmngt-creatingdirs'
|
---|
145 | ]//userinput"
|
---|
146 | mode="pkgmngt"/>
|
---|
147 | </xsl:if>
|
---|
148 | <xsl:if test="@id='ch-system-createfiles' and $pkgmngt='y'">
|
---|
149 | <xsl:apply-templates
|
---|
150 | select="document('packageManager.xml')//sect1[
|
---|
151 | @id='ch-pkgmngt-createfiles'
|
---|
152 | ]//userinput"
|
---|
153 | mode="pkgmngt"/>
|
---|
154 | </xsl:if>
|
---|
155 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
156 | <xsl:text>exit
</xsl:text>
|
---|
157 | </exsl:document>
|
---|
158 | </xsl:if>
|
---|
159 | </xsl:template>
|
---|
160 |
|
---|
161 | <xsl:template match="sect2">
|
---|
162 | <xsl:apply-templates
|
---|
163 | select=".//screen[(not(@role) or
|
---|
164 | @role != 'nodump') and
|
---|
165 | (not(@revision) or
|
---|
166 | @revision=$revision)]/userinput[
|
---|
167 | @remap = 'pre' or
|
---|
168 | @remap = 'configure' or
|
---|
169 | @remap = 'make' or
|
---|
170 | @remap = 'test' and
|
---|
171 | not(current()/../@id='ch-tools-dejagnu') and
|
---|
172 | not(current()/../@id='ch-system-systemd')]"/>
|
---|
173 | <xsl:if
|
---|
174 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
175 | $pkgmngt = 'y' and
|
---|
176 | descendant::screen[not(@role) or
|
---|
177 | @role != 'nodump']/userinput[
|
---|
178 | @remap='install']">
|
---|
179 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
180 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
181 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
182 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
183 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
184 | case $(uname -m) in
|
---|
185 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
186 | esac
|
---|
187 | </xsl:text>
|
---|
188 | </xsl:if>
|
---|
189 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
190 | @role='installation' and
|
---|
191 | $pkgmngt = 'y'">
|
---|
192 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
193 | </xsl:text>
|
---|
194 | </xsl:if>
|
---|
195 | <xsl:apply-templates
|
---|
196 | select=".//screen[(not(@role) or
|
---|
197 | @role != 'nodump') and
|
---|
198 | (not(@revision) or
|
---|
199 | @revision=$revision)]/userinput[@remap = 'install']"/>
|
---|
200 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
201 | $pkgmngt = 'y' and
|
---|
202 | descendant::screen[not(@role) or
|
---|
203 | @role != 'nodump']/userinput[
|
---|
204 | @remap='install']">
|
---|
205 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
206 | <!-- these files are provided by the shadow package -->
|
---|
207 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
208 | </xsl:text>
|
---|
209 | </xsl:if>
|
---|
210 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
211 | March 2013, they are the same pages.
|
---|
212 | November 2015: now they are more accurate
|
---|
213 | in man-pages, and the man5 section is also in man-pages... -->
|
---|
214 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
215 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
---|
216 | rm -fv $PKG_DEST/usr/share/man/man5/*
|
---|
217 | </xsl:text>
|
---|
218 | </xsl:if>
|
---|
219 | <!-- nologin is installed by util-linux. remove it from shadow -->
|
---|
220 | <xsl:if test="../@id = 'ch-system-shadow'">
|
---|
221 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
---|
222 | rm -fv $PKG_DEST/sbin/nologin
|
---|
223 | </xsl:text>
|
---|
224 | </xsl:if>
|
---|
225 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
226 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
227 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
228 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
229 | done
|
---|
230 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
231 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
232 | done
|
---|
233 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
234 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
235 | done
|
---|
236 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
237 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
238 | done
|
---|
239 | PREV_SEC=${SECONDS}
|
---|
240 | packInstall
|
---|
241 | SECONDS=${PREV_SEC}
|
---|
242 | rm -rf $PKG_DEST
|
---|
243 | </xsl:text>
|
---|
244 | </xsl:if>
|
---|
245 | <xsl:if test="$testsuite='3' and
|
---|
246 | ../@id='ch-tools-glibc' and
|
---|
247 | @role='installation'">
|
---|
248 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
249 | <xsl:text>
</xsl:text>
|
---|
250 | </xsl:if>
|
---|
251 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
252 | <xsl:choose>
|
---|
253 | <xsl:when test="$full-locale='y'">
|
---|
254 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
255 | <xsl:text>
</xsl:text>
|
---|
256 | </xsl:when>
|
---|
257 | <xsl:otherwise>
|
---|
258 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
259 | <xsl:text>
</xsl:text>
|
---|
260 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
261 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
262 | <xsl:value-of select="$lang"/>
|
---|
263 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
264 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
265 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
266 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
267 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
268 | fi
|
---|
269 | </xsl:text>
|
---|
270 | </xsl:if>
|
---|
271 | </xsl:otherwise>
|
---|
272 | </xsl:choose>
|
---|
273 | </xsl:if>
|
---|
274 | <xsl:apply-templates
|
---|
275 | select=".//screen[
|
---|
276 | (not(@role) or
|
---|
277 | @role != 'nodump') and
|
---|
278 | (not(@revision) or
|
---|
279 | @revision=$revision)
|
---|
280 | ]/userinput[
|
---|
281 | not(@remap) or
|
---|
282 | @remap='adjust' or
|
---|
283 | @remap='test' and current()/../@id='ch-tools-dejagnu' or
|
---|
284 | @remap='test' and current()/../@id='ch-system-systemd'
|
---|
285 | ]"/>
|
---|
286 | </xsl:template>
|
---|
287 |
|
---|
288 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
289 | <xsl:param name="dirname" select="chapter05"/>
|
---|
290 | <!-- The build order -->
|
---|
291 | <xsl:param name="order" select="062"/>
|
---|
292 | <!-- The file names -->
|
---|
293 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
294 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
295 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
296 | <!-- Creating dirs and files -->
|
---|
297 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
298 | count(descendant::screen/userinput) >
|
---|
299 | count(descendant::screen[@role='nodump'])">
|
---|
300 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
301 | method="text">
|
---|
302 | <xsl:text>#!/bin/bash
|
---|
303 | set +h
|
---|
304 | set -e
|
---|
305 |
|
---|
306 | cd $PKGDIR
|
---|
307 | </xsl:text>
|
---|
308 | <xsl:apply-templates
|
---|
309 | select=".//screen[not(@role) or
|
---|
310 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
311 | mode="pkgmngt"/>
|
---|
312 | <xsl:if test="$dirname = 'chapter06'">
|
---|
313 | <xsl:text>PREV_SEC=${SECONDS}
|
---|
314 | packInstall
|
---|
315 | SECONDS=${PREV_SEC}
|
---|
316 | rm -rf $PKG_DEST
|
---|
317 | </xsl:text>
|
---|
318 | </xsl:if>
|
---|
319 | <xsl:apply-templates
|
---|
320 | select=".//screen[not(@role) or
|
---|
321 | @role != 'nodump'
|
---|
322 | ]/userinput[not(@remap) or
|
---|
323 | @remap='adjust'
|
---|
324 | ]"
|
---|
325 | mode="pkgmngt"/>
|
---|
326 | <xsl:text>
|
---|
327 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
328 | exit
|
---|
329 | </xsl:text>
|
---|
330 | </exsl:document>
|
---|
331 | </xsl:if>
|
---|
332 | </xsl:template>
|
---|
333 |
|
---|
334 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
335 | <xsl:apply-templates/>
|
---|
336 | <xsl:text>
</xsl:text>
|
---|
337 | </xsl:template>
|
---|
338 |
|
---|
339 | <xsl:template match="userinput">
|
---|
340 | <xsl:choose>
|
---|
341 | <!-- Copying the kernel config file -->
|
---|
342 | <xsl:when test="string() = 'make mrproper'">
|
---|
343 | <xsl:text>make mrproper
</xsl:text>
|
---|
344 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
345 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
346 | </xsl:if>
|
---|
347 | </xsl:when>
|
---|
348 | <!-- test instructions -->
|
---|
349 | <xsl:when test="@remap = 'test'">
|
---|
350 | <xsl:choose>
|
---|
351 | <xsl:when test="$testsuite = '0'"/>
|
---|
352 | <xsl:when test="$testsuite = '1' and
|
---|
353 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
354 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
355 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
356 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
357 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
358 | <xsl:when test="$testsuite = '2' and
|
---|
359 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
360 | <xsl:otherwise>
|
---|
361 | <xsl:choose>
|
---|
362 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
363 | <xsl:choose>
|
---|
364 | <!-- special case for glibc -->
|
---|
365 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
366 | <xsl:value-of
|
---|
367 | select="substring-before(string(),'2>&1')"/>
|
---|
368 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
369 | </xsl:when>
|
---|
370 | <!-- special case for procps-ng -->
|
---|
371 | <xsl:when test="contains(string(), 'pushd')">
|
---|
372 | <xsl:text>{ </xsl:text>
|
---|
373 | <xsl:apply-templates/>
|
---|
374 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
375 | </xsl:when>
|
---|
376 | <xsl:when test="contains(string(), 'make -k')">
|
---|
377 | <xsl:apply-templates/>
|
---|
378 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
379 | </xsl:when>
|
---|
380 | <xsl:when test="contains(string(), 'make')">
|
---|
381 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
382 | <xsl:text>make -k</xsl:text>
|
---|
383 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
384 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
385 | </xsl:when>
|
---|
386 | <xsl:otherwise>
|
---|
387 | <xsl:apply-templates/>
|
---|
388 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
389 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
390 | </xsl:if>
|
---|
391 | <xsl:text>
</xsl:text>
|
---|
392 | </xsl:otherwise>
|
---|
393 | </xsl:choose>
|
---|
394 | </xsl:when>
|
---|
395 | <xsl:otherwise>
|
---|
396 | <!-- bomb-testsuite != 'n'-->
|
---|
397 | <xsl:choose>
|
---|
398 | <!-- special case for glibc -->
|
---|
399 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
400 | <xsl:value-of
|
---|
401 | select="substring-before(string(),'2>&1')"/>
|
---|
402 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
403 | </xsl:when>
|
---|
404 | <!-- special case for gmp -->
|
---|
405 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
406 | <xsl:text>(</xsl:text>
|
---|
407 | <xsl:apply-templates/>
|
---|
408 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
409 | </xsl:when>
|
---|
410 | <!-- special case for procps-ng -->
|
---|
411 | <xsl:when test="contains(string(), 'pushd')">
|
---|
412 | <xsl:text>{ </xsl:text>
|
---|
413 | <xsl:apply-templates/>
|
---|
414 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
415 | </xsl:when>
|
---|
416 | <xsl:when test="contains(string(), 'make -k')">
|
---|
417 | <xsl:apply-templates/>
|
---|
418 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
419 | </xsl:when>
|
---|
420 | <xsl:otherwise>
|
---|
421 | <xsl:apply-templates/>
|
---|
422 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
423 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
424 | </xsl:if>
|
---|
425 | <xsl:text>
</xsl:text>
|
---|
426 | </xsl:otherwise>
|
---|
427 | </xsl:choose>
|
---|
428 | </xsl:otherwise>
|
---|
429 | </xsl:choose>
|
---|
430 | </xsl:otherwise>
|
---|
431 | </xsl:choose>
|
---|
432 | </xsl:when>
|
---|
433 | <!-- End of test instructions -->
|
---|
434 | <!-- Don't stop on strip run -->
|
---|
435 | <xsl:when test="contains(string(),'strip ')">
|
---|
436 | <xsl:apply-templates/>
|
---|
437 | <xsl:text> || true
</xsl:text>
|
---|
438 | </xsl:when>
|
---|
439 | <!-- Package management -->
|
---|
440 | <!-- Add $PKG_DEST to installation commands -->
|
---|
441 | <xsl:when test="@remap='install' and
|
---|
442 | not(ancestor::chapter[
|
---|
443 | @id='chapter-temporary-tools'
|
---|
444 | ])">
|
---|
445 | <xsl:choose>
|
---|
446 | <xsl:when test="$pkgmngt='n'">
|
---|
447 | <xsl:choose>
|
---|
448 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
449 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
450 | <xsl:apply-templates/>
|
---|
451 | <xsl:text>
fi
</xsl:text>
|
---|
452 | </xsl:when>
|
---|
453 | <xsl:otherwise>
|
---|
454 | <xsl:apply-templates/>
|
---|
455 | <xsl:text>
</xsl:text>
|
---|
456 | </xsl:otherwise>
|
---|
457 | </xsl:choose>
|
---|
458 | </xsl:when>
|
---|
459 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
460 | <xsl:choose>
|
---|
461 | <xsl:when test="./literal">
|
---|
462 | <xsl:call-template name="outputpkgdest">
|
---|
463 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
464 | </xsl:call-template>
|
---|
465 | <xsl:apply-templates select="literal"/>
|
---|
466 | <xsl:call-template name="outputpkgdest">
|
---|
467 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
468 | </xsl:call-template>
|
---|
469 | </xsl:when>
|
---|
470 | <xsl:otherwise>
|
---|
471 | <xsl:call-template name="outputpkgdest">
|
---|
472 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
473 | </xsl:call-template>
|
---|
474 | </xsl:otherwise>
|
---|
475 | </xsl:choose>
|
---|
476 | </xsl:otherwise>
|
---|
477 | </xsl:choose>
|
---|
478 | </xsl:when>
|
---|
479 | <!-- if package management, we should make an independant package for
|
---|
480 | tzdata. -->
|
---|
481 | <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
---|
482 | <xsl:text>
|
---|
483 | OLD_PKG_DEST=$PKG_DEST
|
---|
484 | OLD_PKGDIR=$PKGDIR
|
---|
485 | PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
---|
486 | PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
---|
487 | <xsl:copy-of select="substring-before(
|
---|
488 | substring-after(string(),'tzdata'),
|
---|
489 | '.tar')"/>
|
---|
490 | <xsl:text>
|
---|
491 | </xsl:text>
|
---|
492 | <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
---|
493 | <xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
---|
494 | <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
---|
495 | <xsl:text>
|
---|
496 | PREV_SEC=${SECONDS}
|
---|
497 | packInstall
|
---|
498 | SECONDS=${PREV_SEC}
|
---|
499 | rm -rf $PKG_DEST
|
---|
500 | PKG_DEST=$OLD_PKG_DEST
|
---|
501 | unset OLD_PKG_DEST
|
---|
502 | PKGDIR=$OLD_PKGDIR
|
---|
503 | unset OLD_PKGDIR
|
---|
504 | </xsl:text>
|
---|
505 | </xsl:when><!-- addition for tzdata + package management -->
|
---|
506 | <!-- End addition for package management -->
|
---|
507 | <!-- The rest of commands -->
|
---|
508 | <xsl:otherwise>
|
---|
509 | <xsl:apply-templates/>
|
---|
510 | <xsl:text>
</xsl:text>
|
---|
511 | </xsl:otherwise>
|
---|
512 | </xsl:choose>
|
---|
513 | </xsl:template>
|
---|
514 |
|
---|
515 | <xsl:template match="replaceable">
|
---|
516 | <xsl:choose>
|
---|
517 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
518 | <xsl:value-of select="$timezone"/>
|
---|
519 | </xsl:when>
|
---|
520 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
521 | <xsl:value-of select="$page"/>
|
---|
522 | </xsl:when>
|
---|
523 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
524 | <xsl:value-of select="$lang"/>
|
---|
525 | </xsl:when>
|
---|
526 | <xsl:otherwise>
|
---|
527 | <xsl:text>**EDITME</xsl:text>
|
---|
528 | <xsl:apply-templates/>
|
---|
529 | <xsl:text>EDITME**</xsl:text>
|
---|
530 | </xsl:otherwise>
|
---|
531 | </xsl:choose>
|
---|
532 | </xsl:template>
|
---|
533 |
|
---|
534 | <xsl:template name="outputpkgdest">
|
---|
535 | <xsl:param name="outputstring" select="foo"/>
|
---|
536 | <xsl:choose>
|
---|
537 | <xsl:when test="contains($outputstring,'make ')">
|
---|
538 | <xsl:choose>
|
---|
539 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
540 | <xsl:call-template name="outputpkgdest">
|
---|
541 | <xsl:with-param name="outputstring"
|
---|
542 | select="substring-before($outputstring,'make')"/>
|
---|
543 | </xsl:call-template>
|
---|
544 | <xsl:call-template name="outputpkgdest">
|
---|
545 | <xsl:with-param
|
---|
546 | name="outputstring"
|
---|
547 | select="substring-after($outputstring,
|
---|
548 | substring-before($outputstring,'make'))"/>
|
---|
549 | </xsl:call-template>
|
---|
550 | </xsl:when>
|
---|
551 | <xsl:otherwise>
|
---|
552 | <xsl:choose>
|
---|
553 | <!-- special cases (no DESTDIR) here -->
|
---|
554 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
555 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
556 | <xsl:value-of
|
---|
557 | select="substring-before(substring-after(string(),'make'),
|
---|
558 | 'install')"/>
|
---|
559 | <xsl:text>install
</xsl:text>
|
---|
560 | </xsl:when>
|
---|
561 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
562 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
563 | </xsl:when>
|
---|
564 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
565 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
566 | </xsl:when>
|
---|
567 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
568 | <xsl:text>make DESTDIR=$PKG_DEST DOCDIR=</xsl:text>
|
---|
569 | <xsl:value-of
|
---|
570 | select="substring-before(substring-after(string(),'DOCDIR='),
|
---|
571 | 'install')"/>
|
---|
572 | <xsl:text>install
</xsl:text>
|
---|
573 | </xsl:when>
|
---|
574 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
575 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
576 | <xsl:value-of
|
---|
577 | select="substring-before(substring-after(string(),'make'),
|
---|
578 | 'install')"/>
|
---|
579 | <xsl:text>install
</xsl:text>
|
---|
580 | </xsl:when>
|
---|
581 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
582 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
583 | <xsl:value-of
|
---|
584 | select="substring-before(substring-after(string(),'make'),
|
---|
585 | 'install')"/>
|
---|
586 | <xsl:text>install
</xsl:text>
|
---|
587 | </xsl:when>
|
---|
588 | <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
---|
589 | <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
---|
590 | <xsl:call-template name="outputpkgdest">
|
---|
591 | <xsl:with-param name="outputstring"
|
---|
592 | select="substring-after($outputstring,'make')"/>
|
---|
593 | </xsl:call-template>
|
---|
594 | </xsl:when>
|
---|
595 | <xsl:otherwise>
|
---|
596 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
597 | <xsl:call-template name="outputpkgdest">
|
---|
598 | <xsl:with-param
|
---|
599 | name="outputstring"
|
---|
600 | select="substring-after($outputstring,'make')"/>
|
---|
601 | </xsl:call-template>
|
---|
602 | </xsl:otherwise>
|
---|
603 | </xsl:choose>
|
---|
604 | </xsl:otherwise>
|
---|
605 | </xsl:choose>
|
---|
606 | </xsl:when>
|
---|
607 | <xsl:when test="contains($outputstring,'ninja ')">
|
---|
608 | <xsl:choose>
|
---|
609 | <xsl:when test="not(starts-with($outputstring,'ninja'))">
|
---|
610 | <xsl:call-template name="outputpkgdest">
|
---|
611 | <xsl:with-param name="outputstring"
|
---|
612 | select="substring-before($outputstring,'ninja')"/>
|
---|
613 | </xsl:call-template>
|
---|
614 | <xsl:call-template name="outputpkgdest">
|
---|
615 | <xsl:with-param
|
---|
616 | name="outputstring"
|
---|
617 | select="substring-after($outputstring,
|
---|
618 | substring-before($outputstring,'ninja'))"/>
|
---|
619 | </xsl:call-template>
|
---|
620 | </xsl:when>
|
---|
621 | <xsl:otherwise> <!-- ninja is the first word -->
|
---|
622 | <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
|
---|
623 | <xsl:call-template name="outputpkgdest">
|
---|
624 | <xsl:with-param
|
---|
625 | name="outputstring"
|
---|
626 | select="substring-after($outputstring,'ninja')"/>
|
---|
627 | </xsl:call-template>
|
---|
628 | </xsl:otherwise>
|
---|
629 | </xsl:choose>
|
---|
630 | </xsl:when>
|
---|
631 | <xsl:otherwise> <!-- no make nor ninja in this string -->
|
---|
632 | <xsl:choose>
|
---|
633 | <xsl:when test="contains($outputstring,'>/') and
|
---|
634 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
635 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
636 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
637 | <xsl:call-template name="outputpkgdest">
|
---|
638 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
639 | </xsl:call-template>
|
---|
640 | </xsl:when>
|
---|
641 | <xsl:when test="contains($outputstring,' /')">
|
---|
642 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
643 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
644 | <xsl:call-template name="outputpkgdest">
|
---|
645 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
646 | </xsl:call-template>
|
---|
647 | </xsl:when>
|
---|
648 | <xsl:otherwise>
|
---|
649 | <xsl:value-of select="$outputstring"/>
|
---|
650 | <xsl:text>
</xsl:text>
|
---|
651 | </xsl:otherwise>
|
---|
652 | </xsl:choose>
|
---|
653 | </xsl:otherwise>
|
---|
654 | </xsl:choose>
|
---|
655 | </xsl:template>
|
---|
656 | </xsl:stylesheet>
|
---|