source: BLFS/xsl/scripts.xsl@ 50618eeb

new_features
Last change on this file since 50618eeb was 50618eeb, checked in by Pierre Labastie <pierre@…>, 8 years ago

Add the possibility to choose build and source dirs, and whether subdirs are
used in blfs tools, + various fixes

  • Property mode set to 100644
File size: 22.8 KB
Line 
1<?xml version="1.0"?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:exsl="http://exslt.org/common"
5 extension-element-prefixes="exsl"
6 version="1.0">
7
8<!-- $Id: scripts.xsl 34 2012-02-21 16:05:09Z labastie $ -->
9
10<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
11
12<!-- Check whether the book is sysv or systemd -->
13 <xsl:variable name="rev">
14 <xsl:choose>
15 <xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
16 systemd
17 </xsl:when>
18 <xsl:otherwise>
19 sysv
20 </xsl:otherwise>
21 </xsl:choose>
22 </xsl:variable>
23
24 <!-- Wrap "root" commands inside a wrapper function, allowing
25 "porg style" package management -->
26 <xsl:param name="wrap-install" select="'n'"/>
27
28 <!-- Build as user (y) or as root (n)? -->
29 <xsl:param name="sudo" select="'y'"/>
30
31 <xsl:template match="/">
32 <xsl:apply-templates select="//sect1"/>
33 </xsl:template>
34
35<!--=================== Master chunks code ======================-->
36
37 <xsl:template match="sect1">
38
39 <xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
40 <!-- The file names -->
41 <xsl:variable name="filename" select="@id"/>
42
43 <!-- The build order -->
44 <xsl:variable name="position" select="position()"/>
45 <xsl:variable name="order">
46 <xsl:choose>
47 <xsl:when test="string-length($position) = 1">
48 <xsl:text>00</xsl:text>
49 <xsl:value-of select="$position"/>
50 </xsl:when>
51 <xsl:when test="string-length($position) = 2">
52 <xsl:text>0</xsl:text>
53 <xsl:value-of select="$position"/>
54 </xsl:when>
55 <xsl:otherwise>
56 <xsl:value-of select="$position"/>
57 </xsl:otherwise>
58 </xsl:choose>
59 </xsl:variable>
60
61 <!-- Depuration code -->
62 <xsl:message>
63 <xsl:text>SCRIPT is </xsl:text>
64 <xsl:value-of select="concat($order,'-z-',$filename)"/>
65 <xsl:text>&#xA; FTPDIR is </xsl:text>
66 <xsl:value-of select="$filename"/>
67 <xsl:text>&#xA;&#xA;</xsl:text>
68 </xsl:message>
69
70 <!-- Creating the scripts -->
71 <exsl:document href="{$order}-z-{$filename}" method="text">
72 <xsl:text>#!/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
73 <xsl:choose>
74 <!-- Package page -->
75 <xsl:when test="sect2[@role='package']">
76 <!-- We build in a subdirectory, whose name may be needed
77 if using package management (see envars.conf), so
78 "export" it -->
79 <xsl:text>export PKG_DIR=</xsl:text>
80 <xsl:value-of select="$filename"/>
81 <xsl:text>
82SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
83BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
84mkdir -p $SRC_DIR
85mkdir -p $BUILD_DIR
86
87</xsl:text>
88 <!-- Download code and build commands -->
89 <xsl:apply-templates select="sect2"/>
90 <!-- Clean-up -->
91 <xsl:text>cd $BUILD_DIR
92[[ -n "$KEEP_FILES" ]] || </xsl:text>
93 <!-- In some case, some files in the build tree are owned
94 by root -->
95 <xsl:if test="$sudo='y'">
96 <xsl:text>sudo </xsl:text>
97 </xsl:if>
98 <xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
99 </xsl:when>
100 <!-- Non-package page -->
101 <xsl:otherwise>
102 <xsl:apply-templates select=".//screen"/>
103 </xsl:otherwise>
104 </xsl:choose>
105 <xsl:text>exit</xsl:text>
106 </exsl:document>
107 </xsl:if>
108 </xsl:template>
109
110<!--======================= Sub-sections code =======================-->
111
112 <xsl:template match="sect2">
113 <xsl:choose>
114 <xsl:when test="@role = 'package'">
115 <xsl:text>cd $SRC_DIR
116</xsl:text>
117 <!-- Download information is in bridgehead tags -->
118 <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
119 <xsl:text>&#xA;</xsl:text>
120 </xsl:when>
121 <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'">
122 <xsl:apply-templates select=".//screen"/>
123 </xsl:when>
124 <xsl:when test="@role = 'installation'">
125 <xsl:text>
126cd $BUILD_DIR
127find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
128 <xsl:if test="$sudo='y'">
129 <xsl:text>sudo </xsl:text>
130 </xsl:if>
131 <xsl:text>rm -rf
132case $PACKAGE in
133 *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
134 tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
135 UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
136 ;;
137 *.tar.lz)
138 bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
139 UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
140 ;;
141 *.zip)
142 zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
143 UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
144 if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
145 unzip $SRC_DIR/$PACKAGE
146 else
147 UNPACKDIR=${PACKAGE%.zip}
148 unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
149 fi
150 ;;
151 *)
152 UNPACKDIR=$PKG_DIR-build
153 mkdir $UNPACKDIR
154 cp $PACKAGE $UNPACKDIR
155 ;;
156esac
157export UNPACKDIR
158cd $UNPACKDIR&#xA;
159</xsl:text>
160 <xsl:apply-templates select=".//screen | .//para/command"/>
161 <xsl:if test="$sudo = 'y'">
162 <xsl:text>sudo /sbin/</xsl:text>
163 </xsl:if>
164 <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
165 </xsl:when>
166 <xsl:when test="@role = 'configuration'">
167 <xsl:apply-templates select=".//screen" mode="config"/>
168 </xsl:when>
169 </xsl:choose>
170 </xsl:template>
171
172<!--==================== Download code =======================-->
173
174 <!-- template for extracting the filename from an url in the form:
175 proto://internet.name/dir1/.../dirn/filename?condition.
176 Needed, because substring-after(...,'/') returns only the
177 substring after the first '/'. -->
178 <xsl:template name="package_name">
179 <xsl:param name="url" select="foo"/>
180 <xsl:param name="sub-url" select="substring-after($url,'/')"/>
181 <xsl:choose>
182 <xsl:when test="contains($sub-url,'/')">
183 <xsl:call-template name="package_name">
184 <xsl:with-param name="url" select="$sub-url"/>
185 </xsl:call-template>
186 </xsl:when>
187 <xsl:otherwise>
188 <xsl:choose>
189 <xsl:when test="contains($sub-url,'?')">
190 <xsl:value-of select="substring-before($sub-url,'?')"/>
191 </xsl:when>
192 <xsl:otherwise>
193 <xsl:value-of select="$sub-url"/>
194 </xsl:otherwise>
195 </xsl:choose>
196 </xsl:otherwise>
197 </xsl:choose>
198 </xsl:template>
199
200 <!-- Generates the code to download a package, an additional package or
201 a patch. -->
202 <xsl:template name="download-file">
203 <xsl:param name="httpurl" select="''"/>
204 <xsl:param name="ftpurl" select="''"/>
205 <xsl:param name="md5" select="''"/>
206 <xsl:param name="varname" select="''"/>
207 <xsl:variable name="package">
208 <xsl:call-template name="package_name">
209 <xsl:with-param name="url">
210 <xsl:choose>
211 <xsl:when test="string-length($httpurl) &gt; 10">
212 <xsl:value-of select="$httpurl"/>
213 </xsl:when>
214 <xsl:otherwise>
215 <xsl:value-of select="$ftpurl"/>
216 </xsl:otherwise>
217 </xsl:choose>
218 </xsl:with-param>
219 </xsl:call-template>
220 </xsl:variable>
221 <xsl:variable name="first_letter"
222 select="translate(substring($package,1,1),
223 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
224 'abcdefghijklmnopqrstuvwxyz')"/>
225 <xsl:text>&#xA;</xsl:text>
226 <xsl:value-of select="$varname"/>
227 <xsl:text>=</xsl:text>
228 <xsl:value-of select="$package"/>
229 <xsl:text>&#xA;if [[ ! -f $</xsl:text>
230 <xsl:value-of select="$varname"/>
231 <xsl:text> ]] ; then&#xA;</xsl:text>
232 <!-- This whole code becomes obsolete because now, it is there or we
233 download; keeping for now, and we may want to grab it from
234 SRC_ARCHIVE when SRC_SUBDIRS is set...
235 <xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
236 <xsl:value-of select="$varname"/>
237 <xsl:text> ]] ; then&#xA;</xsl:text>
238 <xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
239 <xsl:value-of select="$varname"/>
240 <xsl:text> $</xsl:text>
241 <xsl:value-of select="$varname"/>
242 <xsl:text>&#xA;</xsl:text>
243 <xsl:text> elif [[ -f $SRC_ARCHIVE/$</xsl:text>
244 <xsl:value-of select="$varname"/>
245 <xsl:text> ]] ; then&#xA;</xsl:text>
246 <xsl:text> cp $SRC_ARCHIVE/$</xsl:text>
247 <xsl:value-of select="$varname"/>
248 <xsl:text> $</xsl:text>
249 <xsl:value-of select="$varname"/>
250 <xsl:text>&#xA; else&#xA;</xsl:text> -->
251 <!-- Download from upstream http -->
252 <xsl:if test="string-length($httpurl) &gt; 10">
253 <xsl:text> wget -T 30 -t 5 </xsl:text>
254 <xsl:value-of select="$httpurl"/>
255 <xsl:text> ||&#xA;</xsl:text>
256 </xsl:if>
257 <!-- Download from upstream ftp -->
258 <xsl:if test="string-length($ftpurl) &gt; 10">
259 <xsl:text> wget -T 30 -t 5 </xsl:text>
260 <xsl:value-of select="$ftpurl"/>
261 <xsl:text> ||&#xA;</xsl:text>
262 </xsl:if>
263 <!-- The FTP_SERVER mirror as a last resort -->
264 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
265 <xsl:value-of select="$first_letter"/>
266 <xsl:text>/$</xsl:text>
267 <xsl:value-of select="$varname"/>
268 <xsl:text>
269<!-- cp $</xsl:text>
270 <xsl:value-of select="$varname"/>
271 <xsl:text> $SRC_ARCHIVE
272 fi-->
273fi
274</xsl:text>
275 <xsl:if test="string-length($md5) &gt; 10">
276 <xsl:text>echo "</xsl:text>
277 <xsl:value-of select="$md5"/>
278 <xsl:text>&#x20;&#x20;$</xsl:text>
279 <xsl:value-of select="$varname"/>
280 <xsl:text>" | md5sum -c -
281</xsl:text>
282 </xsl:if>
283<!-- link additional packages into $BUILD_DIR, because they are supposed to
284 be there-->
285 <xsl:if test="string($varname) != 'PACKAGE'">
286 <xsl:text>
287[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
288 <xsl:value-of select="$varname"/>
289 <xsl:text> $BUILD_DIR
290</xsl:text>
291 </xsl:if>
292 </xsl:template>
293
294 <!-- Extract the MD5 sum information -->
295 <xsl:template match="para" mode="md5">
296 <xsl:choose>
297 <xsl:when test="contains(substring-after(string(),'sum: '),'&#xA;')">
298 <xsl:value-of select="substring-before(substring-after(string(),'sum: '),'&#xA;')"/>
299 </xsl:when>
300 <xsl:otherwise>
301 <xsl:value-of select="substring-after(string(),'sum: ')"/>
302 </xsl:otherwise>
303 </xsl:choose>
304 </xsl:template>
305
306 <!-- We have several templates itemizedlist, depending on whether we
307 expect the package information, or additional package(s) or patch(es)
308 information. Select the appropriate mode here. -->
309 <xsl:template match="bridgehead">
310 <xsl:choose>
311 <!-- Special case for Openjdk -->
312 <xsl:when test="contains(string(),'Source Package Information')">
313 <xsl:apply-templates
314 select="following-sibling::itemizedlist[1]//simplelist">
315 <xsl:with-param name="varname" select="'PACKAGE'"/>
316 </xsl:apply-templates>
317 <xsl:apply-templates select="following-sibling::itemizedlist
318 [preceding-sibling::bridgehead[1]=current()
319 and position() &gt;1]//simplelist">
320 <xsl:with-param name="varname" select="'PACKAGE1'"/>
321 </xsl:apply-templates>
322 </xsl:when>
323 <!-- Package information -->
324 <xsl:when test="contains(string(),'Package Information')">
325 <xsl:apply-templates select="following-sibling::itemizedlist
326 [preceding-sibling::bridgehead[1]=current()]"
327 mode="package"/>
328 </xsl:when>
329 <!-- Additional package information -->
330 <!-- special case for llvm -->
331 <xsl:when test="contains(string(),'Optional Download')">
332 <xsl:apply-templates select="following-sibling::itemizedlist"
333 mode="additional"/>
334 </xsl:when>
335 <!-- All other additional packages have "Additional" -->
336 <xsl:when test="contains(string(),'Additional')">
337 <xsl:apply-templates select="following-sibling::itemizedlist"
338 mode="additional"/>
339 </xsl:when>
340 <!-- Do not do anything if the dev has created another type of
341 bridgehead. -->
342 <xsl:otherwise/>
343 </xsl:choose>
344 </xsl:template>
345
346 <!-- Call the download code template with appropriate parameters -->
347 <xsl:template match="itemizedlist" mode="package">
348 <xsl:call-template name="download-file">
349 <xsl:with-param name="httpurl">
350 <xsl:value-of select="./listitem[1]/para/ulink/@url"/>
351 </xsl:with-param>
352 <xsl:with-param name="ftpurl">
353 <xsl:value-of select="./listitem/para[contains(string(),'FTP')]/ulink/@url"/>
354 </xsl:with-param>
355 <xsl:with-param name="md5">
356 <xsl:apply-templates select="./listitem/para[contains(string(),'MD5')]"
357 mode="md5"/>
358 </xsl:with-param>
359 <xsl:with-param name="varname" select="'PACKAGE'"/>
360 </xsl:call-template>
361 </xsl:template>
362
363 <xsl:template match="itemizedlist" mode="additional">
364 <!-- The normal layout is "one listitem"<->"one url", but some devs
365 find amusing to have FTP and/or MD5sum listitems, or to
366 enclose the download information inside a simplelist tag... -->
367 <xsl:for-each select="listitem[.//ulink]">
368 <xsl:choose>
369 <!-- hopefully, there was a HTTP line before -->
370 <xsl:when test="contains(string(./para),'FTP')"/>
371 <xsl:when test=".//simplelist">
372 <xsl:apply-templates select=".//simplelist">
373 <xsl:with-param name="varname" select="'PACKAGE1'"/>
374 </xsl:apply-templates>
375 </xsl:when>
376 <xsl:otherwise>
377 <xsl:call-template name="download-file">
378 <xsl:with-param name="httpurl">
379 <xsl:value-of select="./para/ulink/@url"/>
380 </xsl:with-param>
381 <xsl:with-param name="ftpurl">
382 <xsl:value-of
383 select="following-sibling::listitem[1]/
384 para[contains(string(),'FTP')]/ulink/@url"/>
385 </xsl:with-param>
386 <xsl:with-param name="md5">
387 <xsl:apply-templates
388 select="following-sibling::listitem[position()&lt;3]/
389 para[contains(string(),'MD5')]"
390 mode="md5"/>
391 </xsl:with-param>
392 <xsl:with-param name="varname">
393 <xsl:choose>
394 <xsl:when test="contains(./para/ulink/@url,'.patch')">
395 <xsl:text>PATCH</xsl:text>
396 </xsl:when>
397 <xsl:otherwise>
398 <xsl:text>PACKAGE1</xsl:text>
399 </xsl:otherwise>
400 </xsl:choose>
401 </xsl:with-param>
402 </xsl:call-template>
403 </xsl:otherwise>
404 </xsl:choose>
405 </xsl:for-each>
406 </xsl:template>
407
408 <!-- the simplelist case. Hopefully, the layout is one member for
409 url, one for md5 and others for various information, that we do not
410 use -->
411 <xsl:template match="simplelist">
412 <xsl:param name="varname" select="'PACKAGE1'"/>
413 <xsl:call-template name="download-file">
414 <xsl:with-param name="httpurl" select=".//ulink/@url"/>
415 <xsl:with-param name="md5">
416 <xsl:value-of select="substring-after(member[contains(string(),'MD5')],'sum: ')"/>
417 </xsl:with-param>
418 <xsl:with-param name="varname" select="$varname"/>
419 </xsl:call-template>
420 </xsl:template>
421<!--======================== Commands code ==========================-->
422
423 <xsl:template match="screen">
424 <xsl:if test="child::* = userinput and not(@role = 'nodump')">
425 <xsl:choose>
426 <xsl:when test="@role = 'root'">
427 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
428 <xsl:if test="$sudo = 'y'">
429 <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
430 </xsl:if>
431 <xsl:if test="$wrap-install = 'y' and
432 ancestor::sect2[@role='installation']">
433 <xsl:text>if [ -r "$PACK_INSTALL" ]; then
434 source $PACK_INSTALL
435 export -f wrapInstall
436 export -f packInstall
437fi
438wrapInstall '
439</xsl:text>
440 </xsl:if>
441 </xsl:if>
442 <xsl:apply-templates mode="root"/>
443 <xsl:if test="not(following-sibling::screen[1][@role='root'])">
444 <xsl:if test="$wrap-install = 'y' and
445 ancestor::sect2[@role='installation']">
446 <xsl:text>'&#xA;packInstall</xsl:text>
447 </xsl:if>
448 <xsl:if test="$sudo = 'y'">
449 <xsl:text>&#xA;ROOT_EOF</xsl:text>
450 </xsl:if>
451 </xsl:if>
452 </xsl:when>
453 <xsl:otherwise>
454 <xsl:apply-templates select="userinput"/>
455 </xsl:otherwise>
456 </xsl:choose>
457 <xsl:text>&#xA;</xsl:text>
458 </xsl:if>
459 </xsl:template>
460
461 <xsl:template name="set-bootpkg-dir">
462 <xsl:param name="bootpkg" select="'bootscripts'"/>
463 <xsl:param name="url" select="''"/>
464 <xsl:text>[[ ! -d $SRC_DIR/blfs-</xsl:text>
465 <xsl:copy-of select="$bootpkg"/>
466 <xsl:text> ]] &amp;&amp; mkdir $SRC_DIR/blfs-</xsl:text>
467 <xsl:copy-of select="$bootpkg"/>
468 <xsl:text>
469pushd $SRC_DIR/blfs-</xsl:text>
470 <xsl:copy-of select="$bootpkg"/>
471 <xsl:text>
472URL=</xsl:text>
473 <xsl:value-of select="$url"/>
474 <xsl:text>
475BOOTPACKG=$(basename $URL)
476if [[ ! -f $BOOTPACKG ]] ; then
477 if [[ -f $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG ]] ; then
478 cp $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG $BOOTPACKG
479 elif [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then
480 cp $SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
481 else
482 wget -T 30 -t 5 $URL
483 cp $BOOTPACKG $SRC_ARCHIVE
484 fi
485 rm -f unpacked
486fi
487
488if [[ -e unpacked ]] ; then
489 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
490 if ! [[ -d $BOOTUNPACKDIR ]]; then
491 rm unpacked
492 tar -xvf $BOOTPACKG > unpacked
493 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
494 fi
495else
496 tar -xvf $BOOTPACKG > unpacked
497 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
498fi
499cd $BOOTUNPACKDIR
500</xsl:text>
501 </xsl:template>
502
503 <xsl:template match="screen" mode="config">
504 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
505 <xsl:call-template name="set-bootpkg-dir">
506 <xsl:with-param name="bootpkg" select="'bootscripts'"/>
507 <xsl:with-param name="url"
508 select="id('bootscripts')//itemizedlist//ulink/@url"/>
509 </xsl:call-template>
510 </xsl:if>
511 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
512 <xsl:call-template name="set-bootpkg-dir">
513 <xsl:with-param name="bootpkg" select="'systemd-units'"/>
514 <xsl:with-param name="url"
515 select="id('systemd-units')//itemizedlist//ulink/@url"/>
516 </xsl:call-template>
517 </xsl:if>
518 <xsl:apply-templates select='.'/>
519 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
520 @linkend='systemd-units']">
521 <xsl:text>
522popd</xsl:text>
523 </xsl:if>
524 <xsl:text>&#xA;</xsl:text>
525 </xsl:template>
526
527 <xsl:template match="para/command">
528 <xsl:variable name="ns" select="normalize-space(string())"/>
529 <xsl:if test="(contains($ns,'test') or
530 contains($ns,'check'))">
531 <xsl:text>#</xsl:text>
532 <xsl:value-of select="substring-before($ns,'make ')"/>
533 <xsl:text>make </xsl:text>
534 <xsl:if test="not(contains($ns,'-k'))">
535 <xsl:text>-k </xsl:text>
536 </xsl:if>
537 <xsl:value-of select="substring-after($ns,'make ')"/>
538 <xsl:text> || true&#xA;</xsl:text>
539 </xsl:if>
540 </xsl:template>
541
542 <xsl:template match="userinput">
543 <xsl:apply-templates/>
544 </xsl:template>
545
546 <xsl:template match="text()" mode="root">
547 <xsl:call-template name="output-root">
548 <xsl:with-param name="out-string" select="string()"/>
549 </xsl:call-template>
550 </xsl:template>
551
552 <xsl:variable name="APOS">'</xsl:variable>
553
554 <xsl:template name="output-root">
555 <xsl:param name="out-string" select="''"/>
556 <xsl:choose>
557 <xsl:when test="contains($out-string,'make ')">
558 <xsl:call-template name="output-root">
559 <xsl:with-param name="out-string"
560 select="substring-before($out-string,'make ')"/>
561 </xsl:call-template>
562 <xsl:text>make -j1 </xsl:text>
563 <xsl:call-template name="output-root">
564 <xsl:with-param name="out-string"
565 select="substring-after($out-string,'make ')"/>
566 </xsl:call-template>
567 </xsl:when>
568 <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
569 <xsl:call-template name="output-root">
570 <xsl:with-param name="out-string"
571 select="substring-before($out-string,'$')"/>
572 </xsl:call-template>
573 <xsl:text>\$</xsl:text>
574 <xsl:call-template name="output-root">
575 <xsl:with-param name="out-string"
576 select="substring-after($out-string,'$')"/>
577 </xsl:call-template>
578 </xsl:when>
579 <xsl:when test="contains($out-string,'`') and $sudo = 'y'">
580 <xsl:call-template name="output-root">
581 <xsl:with-param name="out-string"
582 select="substring-before($out-string,'`')"/>
583 </xsl:call-template>
584 <xsl:text>\`</xsl:text>
585 <xsl:call-template name="output-root">
586 <xsl:with-param name="out-string"
587 select="substring-after($out-string,'`')"/>
588 </xsl:call-template>
589 </xsl:when>
590 <xsl:when test="contains($out-string,'\') and $sudo = 'y'">
591 <xsl:call-template name="output-root">
592 <xsl:with-param name="out-string"
593 select="substring-before($out-string,'\')"/>
594 </xsl:call-template>
595 <xsl:text>\\</xsl:text>
596 <xsl:call-template name="output-root">
597 <xsl:with-param name="out-string"
598 select="substring-after($out-string,'\')"/>
599 </xsl:call-template>
600 </xsl:when>
601 <xsl:when test="contains($out-string,string($APOS))
602 and $wrap-install = 'y'
603 and ancestor::sect2[@role='installation']">
604 <xsl:call-template name="output-root">
605 <xsl:with-param name="out-string"
606 select="substring-before($out-string,string($APOS))"/>
607 </xsl:call-template>
608 <xsl:text>'\''</xsl:text>
609 <xsl:call-template name="output-root">
610 <xsl:with-param name="out-string"
611 select="substring-after($out-string,string($APOS))"/>
612 </xsl:call-template>
613 </xsl:when>
614 <xsl:otherwise>
615 <xsl:value-of select="$out-string"/>
616 </xsl:otherwise>
617 </xsl:choose>
618 </xsl:template>
619
620 <xsl:template match="replaceable">
621 <xsl:text>**EDITME</xsl:text>
622 <xsl:apply-templates/>
623 <xsl:text>EDITME**</xsl:text>
624 </xsl:template>
625
626 <xsl:template match="replaceable" mode="root">
627 <xsl:text>**EDITME</xsl:text>
628 <xsl:apply-templates/>
629 <xsl:text>EDITME**</xsl:text>
630 </xsl:template>
631
632</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.