source: BLFS/xsl/scripts.xsl@ 59afe73

ablfs-more legacy trunk
Last change on this file since 59afe73 was 1fa0dee, checked in by Pierre Labastie <pierre@…>, 7 years ago

Prepend JH_ to exported variables in jhalfs-blfs, so that collision with
build system variables is unlikely

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