source: BLFS/xsl/scripts.xsl@ 84a3fda

ablfs-more legacy trunk
Last change on this file since 84a3fda was dc7fd7b, checked in by Pierre Labastie <pierre@…>, 7 years ago

Add .la file removal to LFS and BLFS scripts

  • 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 PKG_DIR=</xsl:text>
91 <xsl:value-of select="$filename"/>
92 <xsl:text>
93SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
94BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${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 "$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 $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 UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
147 ;;
148 *.tar.lz)
149 bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
150 UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
151 ;;
152 *.zip)
153 zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
154 UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
155 if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
156 unzip $SRC_DIR/$PACKAGE
157 else
158 UNPACKDIR=${PACKAGE%.zip}
159 unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
160 fi
161 ;;
162 *)
163 UNPACKDIR=$PKG_DIR-build
164 mkdir $UNPACKDIR
165 cp $SRC_DIR/$PACKAGE $UNPACKDIR
166 cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
167 ;;
168esac
169export UNPACKDIR
170cd $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 $SRC_ARCHIVE/$</xsl:text>
245 <xsl:value-of select="$varname"/>
246 <xsl:text> ]] ; then&#xA;</xsl:text>
247 <xsl:text> cp $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 ${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 cp $</xsl:text>
272 <xsl:value-of select="$varname"/>
273 <xsl:text> $SRC_ARCHIVE-->
274 fi
275fi
276</xsl:text>
277 <xsl:if test="string-length($md5) &gt; 10">
278 <xsl:text>echo "</xsl:text>
279 <xsl:value-of select="$md5"/>
280 <xsl:text>&#x20;&#x20;$</xsl:text>
281 <xsl:value-of select="$varname"/>
282 <xsl:text>" | md5sum -c -
283</xsl:text>
284 </xsl:if>
285<!-- link additional packages into $BUILD_DIR, because they are supposed to
286 be there-->
287 <xsl:if test="string($varname) != 'PACKAGE'">
288 <xsl:text>[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
289 <xsl:value-of select="$varname"/>
290 <xsl:text> $BUILD_DIR
291</xsl:text>
292 </xsl:if>
293 </xsl:template>
294
295 <!-- Extract the MD5 sum information -->
296 <xsl:template match="para" mode="md5">
297 <xsl:choose>
298 <xsl:when test="contains(substring-after(string(),'sum: '),'&#xA;')">
299 <xsl:value-of select="substring-before(substring-after(string(),'sum: '),'&#xA;')"/>
300 </xsl:when>
301 <xsl:otherwise>
302 <xsl:value-of select="substring-after(string(),'sum: ')"/>
303 </xsl:otherwise>
304 </xsl:choose>
305 </xsl:template>
306
307 <!-- We have several templates itemizedlist, depending on whether we
308 expect the package information, or additional package(s) or patch(es)
309 information. Select the appropriate mode here. -->
310 <xsl:template match="bridgehead">
311 <xsl:choose>
312 <!-- Special case for Openjdk -->
313 <xsl:when test="contains(string(),'Source Package Information')">
314 <xsl:apply-templates
315 select="following-sibling::itemizedlist[1]//simplelist">
316 <xsl:with-param name="varname" select="'PACKAGE'"/>
317 </xsl:apply-templates>
318 <xsl:apply-templates select="following-sibling::itemizedlist
319 [preceding-sibling::bridgehead[1]=current()
320 and position() &gt;1]//simplelist">
321 <xsl:with-param name="varname" select="'PACKAGE1'"/>
322 </xsl:apply-templates>
323 </xsl:when>
324 <!-- Package information -->
325 <xsl:when test="contains(string(),'Package Information')">
326 <xsl:apply-templates select="following-sibling::itemizedlist
327 [preceding-sibling::bridgehead[1]=current()]"
328 mode="package"/>
329 </xsl:when>
330 <!-- Additional package information -->
331 <!-- special case for llvm -->
332 <xsl:when test="contains(string(),'Optional Download')">
333 <xsl:apply-templates select="following-sibling::itemizedlist"
334 mode="additional"/>
335 </xsl:when>
336 <!-- All other additional packages have "Additional" -->
337 <xsl:when test="contains(string(),'Additional')">
338 <xsl:apply-templates select="following-sibling::itemizedlist"
339 mode="additional"/>
340 </xsl:when>
341 <!-- Do not do anything if the dev has created another type of
342 bridgehead. -->
343 <xsl:otherwise/>
344 </xsl:choose>
345 </xsl:template>
346
347 <!-- Call the download code template with appropriate parameters -->
348 <xsl:template match="itemizedlist" mode="package">
349 <xsl:call-template name="download-file">
350 <xsl:with-param name="httpurl">
351 <xsl:value-of select="./listitem[1]/para/ulink/@url"/>
352 </xsl:with-param>
353 <xsl:with-param name="ftpurl">
354 <xsl:value-of select="./listitem/para[contains(string(),'FTP')]/ulink/@url"/>
355 </xsl:with-param>
356 <xsl:with-param name="md5">
357 <xsl:apply-templates select="./listitem/para[contains(string(),'MD5')]"
358 mode="md5"/>
359 </xsl:with-param>
360 <xsl:with-param name="varname" select="'PACKAGE'"/>
361 </xsl:call-template>
362 </xsl:template>
363
364 <xsl:template match="itemizedlist" mode="additional">
365 <!-- The normal layout is "one listitem"<->"one url", but some devs
366 find amusing to have FTP and/or MD5sum listitems, or to
367 enclose the download information inside a simplelist tag... -->
368 <xsl:for-each select="listitem[.//ulink]">
369 <xsl:choose>
370 <!-- hopefully, there was a HTTP line before -->
371 <xsl:when test="contains(string(./para),'FTP')"/>
372 <xsl:when test=".//simplelist">
373 <xsl:apply-templates select=".//simplelist">
374 <xsl:with-param name="varname" select="'PACKAGE1'"/>
375 </xsl:apply-templates>
376 </xsl:when>
377 <xsl:otherwise>
378 <xsl:call-template name="download-file">
379 <xsl:with-param name="httpurl">
380 <xsl:value-of select="./para/ulink/@url"/>
381 </xsl:with-param>
382 <xsl:with-param name="ftpurl">
383 <xsl:value-of
384 select="following-sibling::listitem[1]/
385 para[contains(string(),'FTP')]/ulink/@url"/>
386 </xsl:with-param>
387 <xsl:with-param name="md5">
388 <xsl:apply-templates
389 select="following-sibling::listitem[position()&lt;3]/
390 para[contains(string(),'MD5')]"
391 mode="md5"/>
392 </xsl:with-param>
393 <xsl:with-param name="varname">
394 <xsl:choose>
395 <xsl:when test="contains(./para/ulink/@url,'.patch')">
396 <xsl:text>PATCH</xsl:text>
397 </xsl:when>
398 <xsl:otherwise>
399 <xsl:text>PACKAGE1</xsl:text>
400 </xsl:otherwise>
401 </xsl:choose>
402 </xsl:with-param>
403 </xsl:call-template>
404 </xsl:otherwise>
405 </xsl:choose>
406 </xsl:for-each>
407 </xsl:template>
408
409 <!-- the simplelist case. Hopefully, the layout is one member for
410 url, one for md5 and others for various information, that we do not
411 use -->
412 <xsl:template match="simplelist">
413 <xsl:param name="varname" select="'PACKAGE1'"/>
414 <xsl:call-template name="download-file">
415 <xsl:with-param name="httpurl" select=".//ulink/@url"/>
416 <xsl:with-param name="md5">
417 <xsl:value-of select="substring-after(member[contains(string(),'MD5')],'sum: ')"/>
418 </xsl:with-param>
419 <xsl:with-param name="varname" select="$varname"/>
420 </xsl:call-template>
421 </xsl:template>
422<!--======================== Commands code ==========================-->
423
424 <xsl:template match="screen">
425 <xsl:if test="child::* = userinput and not(@role = 'nodump')">
426 <xsl:choose>
427 <xsl:when test="@role = 'root'">
428 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
429 <xsl:if test="$sudo = 'y'">
430 <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
431 </xsl:if>
432 <xsl:if test="$wrap-install = 'y' and
433 ancestor::sect2[@role='installation']">
434 <xsl:text>if [ -r "$PACK_INSTALL" ]; then
435 source $PACK_INSTALL
436 export -f wrapInstall
437 export -f packInstall
438fi
439wrapInstall '
440</xsl:text>
441 </xsl:if>
442 </xsl:if>
443 <xsl:apply-templates mode="root"/>
444 <xsl:if test="not(following-sibling::screen[1][@role='root'])">
445 <xsl:if test="$del-la-files = 'y' and
446 ancestor::sect2[@role='installation']">
447 <xsl:call-template name="output-root">
448 <xsl:with-param name="out-string" select="$la-files-instr"/>
449 </xsl:call-template>
450 </xsl:if>
451 <xsl:if test="$wrap-install = 'y' and
452 ancestor::sect2[@role='installation']">
453 <xsl:text>'&#xA;packInstall</xsl:text>
454 </xsl:if>
455 <xsl:if test="$sudo = 'y'">
456 <xsl:text>&#xA;ROOT_EOF</xsl:text>
457 </xsl:if>
458 </xsl:if>
459 </xsl:when>
460 <xsl:otherwise>
461 <xsl:apply-templates select="userinput"/>
462 </xsl:otherwise>
463 </xsl:choose>
464 <xsl:text>&#xA;</xsl:text>
465 </xsl:if>
466 </xsl:template>
467
468 <xsl:template name="set-bootpkg-dir">
469 <xsl:param name="bootpkg" select="'bootscripts'"/>
470 <xsl:param name="url" select="''"/>
471 <xsl:text>BOOTPKG_DIR=blfs-</xsl:text>
472 <xsl:copy-of select="$bootpkg"/>
473 <xsl:text>
474BOOTSRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${BOOTPKG_DIR}}
475BOOTBUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${BOOTPKG_DIR}}
476mkdir -p $BOOTSRC_DIR
477mkdir -p $BOOTBUILD_DIR
478
479pushd $BOOTSRC_DIR
480URL=</xsl:text>
481 <xsl:value-of select="$url"/>
482 <xsl:text>
483BOOTPACKG=$(basename $URL)
484if [[ ! -f $BOOTPACKG ]] ; then
485 if [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then
486 cp $SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
487 else
488 wget -T 30 -t 5 $URL
489 fi
490 rm -f $BOOTBUILD_DIR/unpacked
491fi
492
493cd $BOOTBUILD_DIR
494if [[ -e unpacked ]] ; then
495 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
496 if ! [[ -d $BOOTUNPACKDIR ]]; then
497 tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
498 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
499 fi
500else
501 tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
502 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
503fi
504cd $BOOTUNPACKDIR
505</xsl:text>
506 </xsl:template>
507
508 <xsl:template match="screen" mode="config">
509 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
510 <xsl:call-template name="set-bootpkg-dir">
511 <xsl:with-param name="bootpkg" select="'bootscripts'"/>
512 <xsl:with-param name="url"
513 select="id('bootscripts')//itemizedlist//ulink/@url"/>
514 </xsl:call-template>
515 </xsl:if>
516 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
517 <xsl:call-template name="set-bootpkg-dir">
518 <xsl:with-param name="bootpkg" select="'systemd-units'"/>
519 <xsl:with-param name="url"
520 select="id('systemd-units')//itemizedlist//ulink/@url"/>
521 </xsl:call-template>
522 </xsl:if>
523 <xsl:apply-templates select='.'/>
524 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
525 @linkend='systemd-units']">
526 <xsl:text>
527popd</xsl:text>
528 </xsl:if>
529 <xsl:text>&#xA;</xsl:text>
530 </xsl:template>
531
532 <xsl:template match="para/command">
533 <xsl:variable name="ns" select="normalize-space(string())"/>
534 <xsl:if test="(contains($ns,'test') or
535 contains($ns,'check'))">
536 <xsl:text>#</xsl:text>
537 <xsl:value-of select="substring-before($ns,'make ')"/>
538 <xsl:text>make </xsl:text>
539 <xsl:if test="not(contains($ns,'-k'))">
540 <xsl:text>-k </xsl:text>
541 </xsl:if>
542 <xsl:value-of select="substring-after($ns,'make ')"/>
543 <xsl:text> || true&#xA;</xsl:text>
544 </xsl:if>
545 </xsl:template>
546
547 <xsl:template match="userinput">
548 <xsl:apply-templates/>
549 </xsl:template>
550
551 <xsl:template match="text()" mode="root">
552 <xsl:call-template name="output-root">
553 <xsl:with-param name="out-string" select="string()"/>
554 </xsl:call-template>
555 </xsl:template>
556
557 <xsl:variable name="APOS">'</xsl:variable>
558
559 <xsl:template name="output-root">
560 <xsl:param name="out-string" select="''"/>
561 <xsl:choose>
562 <xsl:when test="contains($out-string,'make ')">
563 <xsl:call-template name="output-root">
564 <xsl:with-param name="out-string"
565 select="substring-before($out-string,'make ')"/>
566 </xsl:call-template>
567 <xsl:text>make -j1 </xsl:text>
568 <xsl:call-template name="output-root">
569 <xsl:with-param name="out-string"
570 select="substring-after($out-string,'make ')"/>
571 </xsl:call-template>
572 </xsl:when>
573 <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
574 <xsl:call-template name="output-root">
575 <xsl:with-param name="out-string"
576 select="substring-before($out-string,'$')"/>
577 </xsl:call-template>
578 <xsl:text>\$</xsl:text>
579 <xsl:call-template name="output-root">
580 <xsl:with-param name="out-string"
581 select="substring-after($out-string,'$')"/>
582 </xsl:call-template>
583 </xsl:when>
584 <xsl:when test="contains($out-string,'`') and $sudo = 'y'">
585 <xsl:call-template name="output-root">
586 <xsl:with-param name="out-string"
587 select="substring-before($out-string,'`')"/>
588 </xsl:call-template>
589 <xsl:text>\`</xsl:text>
590 <xsl:call-template name="output-root">
591 <xsl:with-param name="out-string"
592 select="substring-after($out-string,'`')"/>
593 </xsl:call-template>
594 </xsl:when>
595 <xsl:when test="contains($out-string,'\') and $sudo = 'y'">
596 <xsl:call-template name="output-root">
597 <xsl:with-param name="out-string"
598 select="substring-before($out-string,'\')"/>
599 </xsl:call-template>
600 <xsl:text>\\</xsl:text>
601 <xsl:call-template name="output-root">
602 <xsl:with-param name="out-string"
603 select="substring-after($out-string,'\')"/>
604 </xsl:call-template>
605 </xsl:when>
606 <xsl:when test="contains($out-string,string($APOS))
607 and $wrap-install = 'y'
608 and ancestor::sect2[@role='installation']">
609 <xsl:call-template name="output-root">
610 <xsl:with-param name="out-string"
611 select="substring-before($out-string,string($APOS))"/>
612 </xsl:call-template>
613 <xsl:text>'\''</xsl:text>
614 <xsl:call-template name="output-root">
615 <xsl:with-param name="out-string"
616 select="substring-after($out-string,string($APOS))"/>
617 </xsl:call-template>
618 </xsl:when>
619 <xsl:otherwise>
620 <xsl:value-of select="$out-string"/>
621 </xsl:otherwise>
622 </xsl:choose>
623 </xsl:template>
624
625 <xsl:template match="replaceable">
626 <xsl:text>**EDITME</xsl:text>
627 <xsl:apply-templates/>
628 <xsl:text>EDITME**</xsl:text>
629 </xsl:template>
630
631 <xsl:template match="replaceable" mode="root">
632 <xsl:text>**EDITME</xsl:text>
633 <xsl:apply-templates/>
634 <xsl:text>EDITME**</xsl:text>
635 </xsl:template>
636
637</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.