source: BLFS/xsl/scripts.xsl@ 6cf2868

ablfs
Last change on this file since 6cf2868 was 9683707, checked in by Pierre Labastie <pierre@…>, 13 years ago

Added unpacking instruction for "zip"ped packages in generated scripts

  • Property mode set to 100644
File size: 18.2 KB
RevLine 
[3c10176]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
[63fc514]8<!-- $Id: scripts.xsl 34 2012-02-21 16:05:09Z labastie $ -->
[3c10176]9
10<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
11
[c0bc66d]12 <!-- Build as user (y) or as root (n)? -->
13 <xsl:param name="sudo" select="y"/>
14
[3c10176]15 <xsl:template match="/">
16 <xsl:apply-templates select="//sect1"/>
17 </xsl:template>
18
19<!--=================== Master chunks code ======================-->
20
21 <xsl:template match="sect1">
22
[63fc514]23 <xsl:if test="@id != 'bootscripts'">
[3c10176]24 <!-- The file names -->
[f4ed135]25 <xsl:variable name="filename" select="@id"/>
[3c10176]26
27 <!-- The build order -->
28 <xsl:variable name="position" select="position()"/>
29 <xsl:variable name="order">
30 <xsl:choose>
31 <xsl:when test="string-length($position) = 1">
32 <xsl:text>00</xsl:text>
33 <xsl:value-of select="$position"/>
34 </xsl:when>
35 <xsl:when test="string-length($position) = 2">
36 <xsl:text>0</xsl:text>
37 <xsl:value-of select="$position"/>
38 </xsl:when>
39 <xsl:otherwise>
40 <xsl:value-of select="$position"/>
41 </xsl:otherwise>
42 </xsl:choose>
43 </xsl:variable>
44
45 <!-- Depuration code -->
46 <xsl:message>
47 <xsl:text>SCRIPT is </xsl:text>
[63fc514]48 <xsl:value-of select="concat($order,'-z-',$filename)"/>
[3c10176]49 <xsl:text>&#xA; FTPDIR is </xsl:text>
[63fc514]50 <xsl:value-of select="$filename"/>
[3c10176]51 <xsl:text>&#xA;&#xA;</xsl:text>
52 </xsl:message>
53
54 <!-- Creating the scripts -->
[73c3c1c]55 <exsl:document href="{$order}-z-{$filename}" method="text">
[91ff6a9]56 <xsl:text>#!/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
[3c10176]57 <xsl:choose>
58 <!-- Package page -->
[b45f723]59 <xsl:when test="sect2[@role='package'] and not(@id = 'xorg7-app' or
60 @id = 'xorg7-data' or @id = 'xorg7-driver' or
61 @id = 'xorg7-font' or @id = 'xorg7-lib' or
62 @id = 'xorg7-proto' or @id = 'xorg7-util')">
[3c10176]63 <!-- Variables -->
[63fc514]64 <!-- These three lines could be important if SRC_ARCHIVE,
65 FTP_SERVER and SRCDIR were not set in the environment.
66 But they are not tested for length or anything later,
67 so not needed
[3c10176]68 <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE&#xA;</xsl:text>
[63fc514]69 <xsl:text>FTP_SERVER=$FTP_SERVER&#xA;</xsl:text>
70 <xsl:text>SRC_DIR=$SRC_DIR&#xA;&#xA;</xsl:text>-->
[3c10176]71 <xsl:text>&#xA;PKG_DIR=</xsl:text>
[63fc514]72 <xsl:value-of select="$filename"/>
73 <xsl:text>&#xA;</xsl:text>
[3c10176]74 <!-- Download code and build commands -->
[63fc514]75 <xsl:apply-templates select="sect2"/>
[3c10176]76 <!-- Clean-up -->
[63fc514]77 <!-- xorg7-server used to require mesalib tree being present.
78 That is no more true
79 <xsl:if test="not(@id='mesalib')"> -->
[5fb652f]80 <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
[5e9076f]81 <!-- In some case, some files in the build tree are owned
82 by root -->
83 <xsl:if test="$sudo='y'">
84 <xsl:text>sudo </xsl:text>
85 </xsl:if>
[5fb652f]86 <xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
[63fc514]87 <!-- Same reason as preceding comment
[5fb652f]88 </xsl:if>
89 <xsl:if test="@id='xorg7-server'">
90 <xsl:text>cd $SRC_DIR/MesaLib
91UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
92rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
[63fc514]93 </xsl:if> -->
[3c10176]94 </xsl:when>
[b45f723]95 <!-- Xorg7 pseudo-packages -->
96 <xsl:when test="contains(@id,'xorg7') and not(@id = 'xorg7-server')">
[63fc514]97 <xsl:text># Useless SRC_DIR=$SRC_DIR
[b45f723]98
99cd $SRC_DIR
100mkdir -p xc
101cd xc&#xA;</xsl:text>
102 <xsl:apply-templates select="sect2" mode="xorg7"/>
103 </xsl:when>
[3c10176]104 <!-- Non-package page -->
105 <xsl:otherwise>
106 <xsl:apply-templates select=".//screen"/>
107 </xsl:otherwise>
108 </xsl:choose>
109 <xsl:text>exit</xsl:text>
110 </exsl:document>
111 </xsl:if>
112 </xsl:template>
113
114<!--======================= Sub-sections code =======================-->
115
116 <xsl:template match="sect2">
117 <xsl:choose>
118 <xsl:when test="@role = 'package'">
[f65d3cb]119 <xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
120 <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
[63fc514]121 <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
[3c10176]122 <xsl:text>&#xA;</xsl:text>
123 </xsl:when>
124 <xsl:when test="@role = 'installation'">
[859d863]125 <xsl:text>
[9683707]126if [ "${PACKAGE%.zip}" = "${PACKAGE}" ]; then
127 if [[ -e unpacked ]] ; then
[859d863]128 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
[efef736]129 [[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
[9683707]130 fi
131 tar -xvf $PACKAGE > unpacked
132 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
133else
134 UNPACKDIR=${PACKAGE%.zip}
135 [[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
136 unzip -d $UNPACKDIR ${PACKAGE}
[859d863]137fi
[6ff1be4]138cd $UNPACKDIR&#xA;</xsl:text>
[3c10176]139 <xsl:apply-templates select=".//screen | .//para/command"/>
[a1d0d5c]140 <xsl:if test="$sudo = 'y'">
[52b0d10]141 <xsl:text>sudo /sbin/</xsl:text>
[a1d0d5c]142 </xsl:if>
143 <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
[3c10176]144 </xsl:when>
145 <xsl:when test="@role = 'configuration'">
[63fc514]146 <xsl:apply-templates select=".//screen" mode="config"/>
[3c10176]147 </xsl:when>
148 </xsl:choose>
149 </xsl:template>
150
[b45f723]151 <xsl:template match="sect2" mode="xorg7">
152 <xsl:choose>
[0efb837]153 <xsl:when test="@role = 'package'">
154 <xsl:apply-templates select="itemizedlist/listitem/para" mode="xorg7"/>
155 </xsl:when>
[b45f723]156 <xsl:when test="not(@role)">
[63fc514]157<!-- Useless <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
158FTP_SERVER=$FTP_SERVER&#xA;</xsl:text> -->
[0efb837]159 <xsl:apply-templates select=".//screen" mode="sect-ver"/>
[a70c289]160 <xsl:text>mkdir -p ${section}&#xA;cd ${section}&#xA;</xsl:text>
161 <xsl:apply-templates select="../sect2[@role='package']/itemizedlist/listitem/para" mode="xorg7-patch"/>
[9d9a810]162 <xsl:text>for line in $(grep -v '^#' ../${sect_ver}.wget) ; do
[1caf1f4]163 if [[ ! -f ${line} ]] ; then
164 if [[ -f $SRC_ARCHIVE/Xorg/${section}/${line} ]] ; then
165 cp $SRC_ARCHIVE/Xorg/${section}/${line} ${line}
166 elif [[ -f $SRC_ARCHIVE/Xorg/${line} ]] ; then
167 cp $SRC_ARCHIVE/Xorg/${line} ${line}
168 elif [[ -f $SRC_ARCHIVE/${section}/${line} ]] ; then
169 cp $SRC_ARCHIVE/${section}/${line} ${line}
170 elif [[ -f $SRC_ARCHIVE/${line} ]] ; then
171 cp $SRC_ARCHIVE/${line} ${line}
[a70c289]172 else
[63fc514]173 wget -T 30 -t 5 ${FTP_X_SERVER}pub/individual/${section}/${line} || \
174 wget -T 30 -t 5 http://xorg.freedesktop.org/releases/individual/${section}/${line}
[a70c289]175 fi
176 fi
177done
[9d9a810]178md5sum -c ../${sect_ver}.md5
179cp ../${sect_ver}.wget ../${sect_ver}.wget.orig
180cp ../${sect_ver}.md5 ../${sect_ver}.md5.orig&#xA;</xsl:text>
[b45f723]181 </xsl:when>
182 <xsl:when test="@role = 'installation'">
[9d9a810]183 <xsl:text>for package in $(grep -v '^#' ../${sect_ver}.wget) ; do
[b45f723]184 packagedir=$(echo $package | sed 's/.tar.bz2//')
[1caf1f4]185 tar -xf ${package}
186 cd ${packagedir}&#xA;</xsl:text>
[b45f723]187 <xsl:apply-templates select=".//screen | .//para/command"/>
[5be3651]188 <xsl:text> cd ..
[1caf1f4]189 rm -rf ${packagedir}
[9d9a810]190 sed -i "/${package}/d" ../${sect_ver}.wget
191 sed -i "/${package}/d" ../${sect_ver}.md5
[a70c289]192done
[9d9a810]193mv ../${sect_ver}.wget.orig ../${sect_ver}.wget
194mv ../${sect_ver}.md5.orig ../${sect_ver}.md5&#xA;</xsl:text>
[b45f723]195 <xsl:if test="$sudo = 'y'">
[52b0d10]196 <xsl:text>sudo /sbin/</xsl:text>
[b45f723]197 </xsl:if>
198 <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
199 </xsl:when>
[0efb837]200 <xsl:when test="@role = 'configuration'">
201 <xsl:apply-templates select=".//screen"/>
202 <xsl:text>&#xA;</xsl:text>
203 </xsl:when>
[b45f723]204 </xsl:choose>
205 </xsl:template>
206
[3c10176]207<!--==================== Download code =======================-->
208
209 <xsl:template name="package_name">
210 <xsl:param name="url" select="foo"/>
211 <xsl:param name="sub-url" select="substring-after($url,'/')"/>
212 <xsl:choose>
213 <xsl:when test="contains($sub-url,'/')">
214 <xsl:call-template name="package_name">
215 <xsl:with-param name="url" select="$sub-url"/>
216 </xsl:call-template>
217 </xsl:when>
218 <xsl:otherwise>
219 <xsl:choose>
220 <xsl:when test="contains($sub-url,'?')">
221 <xsl:value-of select="substring-before($sub-url,'?')"/>
222 </xsl:when>
[63fc514]223<!-- Should never happen
224 <xsl:when test="contains($sub-url,'.patch')"/> -->
[3c10176]225 <xsl:otherwise>
226 <xsl:value-of select="$sub-url"/>
227 </xsl:otherwise>
228 </xsl:choose>
229 </xsl:otherwise>
230 </xsl:choose>
231 </xsl:template>
232
[63fc514]233 <xsl:template match="bridgehead">
[3c10176]234 <xsl:choose>
[63fc514]235 <xsl:when test="string()='Package Information'">
236 <xsl:variable name="url">
237 <xsl:choose>
238 <xsl:when
239 test="string-length(
240 following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url)
241 &gt; 10">
242 <xsl:value-of select=
243 "following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url"/>
244 </xsl:when>
245 <xsl:otherwise>
246 <xsl:value-of select=
247 "following-sibling::itemizedlist[1]/listitem[2]/para/ulink/@url"/>
248 </xsl:otherwise>
249 </xsl:choose>
[3c10176]250 </xsl:variable>
[63fc514]251 <xsl:variable name="package">
252 <xsl:call-template name="package_name">
253 <xsl:with-param name="url" select="$url"/>
254 </xsl:call-template>
255 </xsl:variable>
256 <xsl:variable
257 name="first_letter"
258 select="translate(substring($package,1,1),
259 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
260 'abcdefghijklmnopqrstuvwxyz')"/>
261 <xsl:text>PACKAGE=</xsl:text>
262 <xsl:value-of select="$package"/>
263 <xsl:text>&#xA;if [[ ! -f $PACKAGE ]] ; then&#xA;</xsl:text>
[3c10176]264 <!-- SRC_ARCHIVE may have subdirectories or not -->
265 <xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then&#xA;</xsl:text>
266 <xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE&#xA;</xsl:text>
267 <xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then&#xA;</xsl:text>
268 <xsl:text> cp $SRC_ARCHIVE/$PACKAGE $PACKAGE&#xA; else&#xA;</xsl:text>
269 <!-- The FTP_SERVER mirror -->
[63fc514]270 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
271 <xsl:value-of select="$first_letter"/>
272 <xsl:text>/$PACKAGE</xsl:text>
273 <xsl:apply-templates
274 select="following-sibling::itemizedlist[1]/listitem/para"
275 mode="package"/>
276 </xsl:when>
277 <xsl:when test="string()='Additional Downloads'">
278 <xsl:apply-templates
279 select="following-sibling::itemizedlist[1]/listitem/para"
280 mode="additional"/>
281 </xsl:when>
282 <xsl:otherwise/>
283 </xsl:choose>
284 </xsl:template>
285
286 <xsl:template match="para" mode="package">
287 <xsl:choose>
288 <xsl:when test="contains(string(),'HTTP')">
[3c10176]289 <!-- Upstream HTTP URL -->
[f221c2c]290 <xsl:if test="string-length(ulink/@url) &gt; '10'">
[63fc514]291 <xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
[f221c2c]292 <xsl:choose>
293 <xsl:when test="contains(ulink/@url,'?')">
294 <xsl:value-of select="substring-before(ulink/@url,'?')"/>
295 </xsl:when>
296 <xsl:otherwise>
297 <xsl:value-of select="ulink/@url"/>
298 </xsl:otherwise>
299 </xsl:choose>
[63fc514]300 <xsl:if test="not(contains(string(parent::listitem/following-sibling::listitem[1]/para),'FTP'))">
301 <xsl:text>&#xA; fi&#xA;fi&#xA;</xsl:text>
302 </xsl:if>
[3c10176]303 </xsl:if>
304 </xsl:when>
305 <xsl:when test="contains(string(),'FTP')">
306 <!-- Upstream FTP URL -->
307 <xsl:if test="string-length(ulink/@url) &gt; '10'">
[63fc514]308 <xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
[3c10176]309 <xsl:value-of select="ulink/@url"/>
310 </xsl:if>
311 <xsl:text>&#xA; fi&#xA;fi&#xA;</xsl:text>
312 </xsl:when>
313 <xsl:when test="contains(string(),'MD5')">
314 <xsl:text>echo "</xsl:text>
315 <xsl:value-of select="substring-after(string(),'sum: ')"/>
316 <xsl:text>&#x20;&#x20;$PACKAGE" | md5sum -c -&#xA;</xsl:text>
317 </xsl:when>
[63fc514]318 </xsl:choose>
319 </xsl:template>
320
321 <xsl:template match="para" mode="additional">
322 <xsl:choose>
[3c10176]323 <xsl:when test="contains(string(ulink/@url),'.patch')">
[63fc514]324 <xsl:text>wget -T 30 -t 5 </xsl:text>
[3c10176]325 <xsl:value-of select="ulink/@url"/>
326 <xsl:text>&#xA;</xsl:text>
327 </xsl:when>
[63fc514]328 <xsl:when test="ulink">
329 <xsl:if test="string-length(ulink/@url) &gt; '10'">
330 <xsl:variable name="package">
331 <xsl:call-template name="package_name">
332 <xsl:with-param name="url" select="ulink/@url"/>
333 </xsl:call-template>
334 </xsl:variable>
335 <xsl:variable
336 name="first_letter"
337 select="translate(substring($package,1,1),
338 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
339 'abcdefghijklmnopqrstuvwxyz')"/>
340 <xsl:text>PACKAGE1=</xsl:text>
341 <xsl:value-of select="$package"/>
342 <xsl:text>&#xA;if [[ ! -f $PACKAGE1 ]] ; then&#xA;</xsl:text>
343 <!-- SRC_ARCHIVE may have subdirectories or not -->
344 <xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 ]] ; then&#xA;</xsl:text>
345 <xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 $PACKAGE1&#xA;</xsl:text>
346 <xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE1 ]] ; then&#xA;</xsl:text>
347 <xsl:text> cp $SRC_ARCHIVE/$PACKAGE1 $PACKAGE1&#xA; else&#xA;</xsl:text>
348 <!-- The FTP_SERVER mirror -->
349 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}blfs/svn/</xsl:text>
350 <xsl:value-of select="$first_letter"/>
351 <xsl:text>/$PACKAGE1</xsl:text>
352 <xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
353 <xsl:value-of select="ulink/@url"/>
354 <xsl:text>&#xA; fi&#xA;fi&#xA;</xsl:text>
355 </xsl:if>
356 </xsl:when>
357 <xsl:when test="contains(string(),'MD5')">
358 <xsl:text>echo "</xsl:text>
359 <xsl:value-of select="substring-after(string(),'sum: ')"/>
360 <xsl:text>&#x20;&#x20;$PACKAGE1" | md5sum -c -&#xA;</xsl:text>
361 </xsl:when>
[3c10176]362 </xsl:choose>
363 </xsl:template>
364
[5be3651]365 <xsl:template match="itemizedlist/listitem/para" mode="xorg7">
[0efb837]366 <xsl:if test="contains(string(ulink/@url),'.md5') or
367 contains(string(ulink/@url),'.wget')">
[63fc514]368 <xsl:text>wget -T 30 -t 5 </xsl:text>
[0efb837]369 <xsl:value-of select="ulink/@url"/>
370 <xsl:text>&#xA;</xsl:text>
371 </xsl:if>
372 </xsl:template>
373
374 <xsl:template match="itemizedlist/listitem/para" mode="xorg7-patch">
[5be3651]375 <xsl:if test="contains(string(ulink/@url),'.patch')">
[63fc514]376 <xsl:text>wget -T 30 -t 5 </xsl:text>
[5be3651]377 <xsl:value-of select="ulink/@url"/>
378 <xsl:text>&#xA;</xsl:text>
379 </xsl:if>
380 </xsl:template>
381
[3c10176]382<!--======================== Commands code ==========================-->
383
384 <xsl:template match="screen">
385 <xsl:if test="child::* = userinput and not(@role = 'nodump')">
[96a30c7]386 <xsl:choose>
387 <xsl:when test="@role = 'root'">
388 <xsl:if test="$sudo = 'y'">
389 <xsl:text>sudo sh -c '</xsl:text>
390 </xsl:if>
391 <xsl:apply-templates select="userinput" mode="root"/>
392 <xsl:if test="$sudo = 'y'">
393 <xsl:text>'</xsl:text>
394 </xsl:if>
395 </xsl:when>
396 <xsl:otherwise>
397 <xsl:apply-templates select="userinput"/>
398 </xsl:otherwise>
399 </xsl:choose>
[3c10176]400 <xsl:text>&#xA;</xsl:text>
401 </xsl:if>
402 </xsl:template>
403
[63fc514]404 <xsl:template match="screen" mode="config">
405 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
406 <xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] &amp;&amp; mkdir $SRC_DIR/blfs-bootscripts
407pushd $SRC_DIR/blfs-bootscripts
408URL=</xsl:text>
409 <xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text>
410BOOTPACKG=$(basename $URL)
411[[ ! -f "$BOOTPACKG" ]] &amp;&amp; { wget -T 30 -t 5 $URL; rm -f unpacked; }
412if [[ -e unpacked ]] ; then
413 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
414 if ! [[ -d $UNPACKDIR ]]; then
415 rm unpacked
416 tar -xvf $BOOTPACKG > unpacked
417 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
418 fi
419else
420 tar -xvf $BOOTPACKG > unpacked
421 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
422fi
423cd $UNPACKDIR
424</xsl:text>
425 </xsl:if>
426 <xsl:apply-templates select='.'/>
427 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
428 <xsl:text>
429popd</xsl:text>
430 </xsl:if>
431 <xsl:text>&#xA;</xsl:text>
432 </xsl:template>
433
[0efb837]434 <xsl:template match="screen" mode="sect-ver">
[a70c289]435 <xsl:text>section=</xsl:text>
436 <xsl:value-of select="substring-before(substring-after(string(),'mkdir '),' &amp;')"/>
[9d9a810]437 <xsl:text>&#xA;sect_ver=</xsl:text>
[0efb837]438 <xsl:value-of select="substring-before(substring-after(string(),'-c ../'),'.md5')"/>
439 <xsl:text>&#xA;</xsl:text>
[b45f723]440 </xsl:template>
441
[3c10176]442 <xsl:template match="para/command">
443 <xsl:if test="(contains(string(),'test') or
444 contains(string(),'check'))">
445 <xsl:text>#</xsl:text>
446 <xsl:value-of select="substring-before(string(),'make')"/>
447 <xsl:text>make -k</xsl:text>
448 <xsl:value-of select="substring-after(string(),'make')"/>
449 <xsl:text> || true&#xA;</xsl:text>
450 </xsl:if>
451 </xsl:template>
452
453 <xsl:template match="userinput">
454 <xsl:apply-templates/>
455 </xsl:template>
456
[96a30c7]457 <xsl:template match="userinput" mode="root">
458 <xsl:for-each select="child::node()">
459 <xsl:choose>
460 <xsl:when test="self::text() and contains(string(),'make')">
461 <xsl:value-of select="substring-before(string(),'make')"/>
462 <xsl:text>make -j1</xsl:text>
463 <xsl:value-of select="substring-after(string(),'make')"/>
464 </xsl:when>
465 <xsl:otherwise>
466 <xsl:apply-templates select="self::node()"/>
467 </xsl:otherwise>
468 </xsl:choose>
469 </xsl:for-each>
470 </xsl:template>
471
[3c10176]472 <xsl:template match="replaceable">
[63fc514]473<!-- Not needed anymore
[5fb652f]474 <xsl:choose>
475 <xsl:when test="ancestor::sect1[@id='xorg7-server']">
476 <xsl:text>$SRC_DIR/MesaLib</xsl:text>
477 </xsl:when>
[63fc514]478 <xsl:otherwise> -->
[5fb652f]479 <xsl:text>**EDITME</xsl:text>
480 <xsl:apply-templates/>
481 <xsl:text>EDITME**</xsl:text>
[63fc514]482<!-- </xsl:otherwise>
483 </xsl:choose> -->
[3c10176]484 </xsl:template>
485
486</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.