source: BLFS/xsl/make_book.xsl@ e3ccc27

ablfs-more legacy trunk
Last change on this file since e3ccc27 was 0a0b609, checked in by Pierre Labastie <pierre@…>, 5 years ago

Several things:

  • refactor again process-install. Allows for better generation of test instructions
  • only output the instructions of the first sect2 with role="installation". this will miss the vaapi intel driver, the installation of help files in GIMP, and the second method for which
  • always run porg logging in "append" mode
  • allows pass1 in sect2 (libva again)
  • Property mode set to 100644
File size: 26.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2
3<!-- $Id$ -->
4
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
7
8 <xsl:param name="list" select="''"/>
9 <xsl:param name="MTA" select="'sendmail'"/>
10 <xsl:param name="lfsbook" select="'lfs-full.xml'"/>
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 <xsl:text>systemd</xsl:text>
17 </xsl:when>
18 <xsl:otherwise>
19 <xsl:text>sysv</xsl:text>
20 </xsl:otherwise>
21 </xsl:choose>
22 </xsl:variable>
23
24 <xsl:output
25 method="xml"
26 encoding="ISO-8859-1"
27 doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
28
29 <xsl:include href="lfs_make_book.xsl"/>
30
31 <xsl:template match="/">
32 <book>
33 <xsl:copy-of select="/book/bookinfo"/>
34 <preface>
35 <?dbhtml filename="preface.html"?>
36 <title>Preface</title>
37 <xsl:choose>
38 <xsl:when test="$rev='sysv'">
39 <xsl:copy-of select="id('bootscripts')"/>
40 </xsl:when>
41 <xsl:otherwise>
42 <xsl:copy-of select="id('systemd-units')"/>
43 </xsl:otherwise>
44 </xsl:choose>
45 </preface>
46 <chapter>
47 <?dbhtml filename="chapter.html"?>
48 <title>Installing packages in dependency build order</title>
49 <xsl:call-template name="apply-list">
50 <xsl:with-param name="list" select="normalize-space($list)"/>
51 </xsl:call-template>
52 </chapter>
53 <xsl:copy-of select="id('CC')"/>
54 <xsl:copy-of select="id('MIT')"/>
55 <index/>
56 </book>
57 </xsl:template>
58
59<!-- apply-templates for each item in the list.
60 Normally, those items are id of nodes.
61 Those nodes can be sect1 (normal case),
62 sect2 (python modules or DBus bindings)
63 bridgehead (perl modules)
64 para (dependency of perl modules).
65 The templates after this one treat each of those cases.
66 However, some items are xorg package names, and not id.
67 We need special instructions in that case.
68 The difficulty is that some of those names *are* id's,
69 because they are referenced in the index.
70 Hopefully, none of those id's are sect{1,2}, bridgehead or para...-->
71 <xsl:template name="apply-list">
72 <xsl:param name="list" select="''"/>
73 <xsl:if test="string-length($list) &gt; 0">
74 <xsl:choose>
75 <xsl:when test="contains($list,' ')">
76 <xsl:call-template name="apply-list">
77 <xsl:with-param name="list"
78 select="substring-before($list,' ')"/>
79 </xsl:call-template>
80 <xsl:call-template name="apply-list">
81 <xsl:with-param name="list"
82 select="substring-after($list,' ')"/>
83 </xsl:call-template>
84 </xsl:when>
85 <xsl:when test="contains($list,'groupxx')"/>
86 <xsl:otherwise>
87 <xsl:variable name="is-lfs">
88 <xsl:call-template name="detect-lfs">
89 <xsl:with-param name="package" select="$list"/>
90 <xsl:with-param name="lfsbook" select="$lfsbook"/>
91 </xsl:call-template>
92 </xsl:variable>
93 <xsl:choose>
94 <xsl:when test="$is-lfs='true'">
95 <xsl:message>
96 <xsl:value-of select="$list"/>
97 <xsl:text> is an lfs package</xsl:text>
98 </xsl:message>
99 <xsl:call-template name="process-lfs">
100 <xsl:with-param name="package" select="$list"/>
101 <xsl:with-param name="lfsbook" select="$lfsbook"/>
102 </xsl:call-template>
103 </xsl:when>
104 <xsl:when test="contains(concat($list,' '),'-pass1 ')">
105<!-- We need to do it only for sect1 and sect2, because of libva -->
106 <xsl:variable
107 name="real-id"
108 select="substring-before(concat($list,' '),'-pass1 ')"/>
109 <xsl:if test="id($real-id)[self::sect1]">
110 <xsl:apply-templates select="id($real-id)" mode="pass1"/>
111 </xsl:if>
112 <xsl:if test="id($real-id)[self::sect2]">
113 <xsl:apply-templates select="id($real-id)" mode="pass1-sect2"/>
114 </xsl:if>
115 </xsl:when>
116 <xsl:when test="not(id($list)[self::sect1 or self::sect2 or self::para or self::bridgehead])">
117 <xsl:apply-templates
118 select="//sect1[contains(@id,'xorg7')
119 and contains(string(.//userinput),
120 concat($list,'-'))]"
121 mode="xorg">
122 <xsl:with-param name="package" select="$list"/>
123 </xsl:apply-templates>
124 </xsl:when>
125 <xsl:otherwise>
126 <xsl:apply-templates select="id($list)"/>
127 </xsl:otherwise>
128 </xsl:choose>
129 </xsl:otherwise>
130 </xsl:choose>
131 </xsl:if>
132 </xsl:template>
133
134<!-- The normal case : just copy to the book. Exceptions are if there
135 is a xref, so use a special "mode" template -->
136 <xsl:template match="sect1">
137 <xsl:apply-templates select="." mode="sect1"/>
138 </xsl:template>
139
140 <xsl:template match="*" mode="pass1">
141 <xsl:choose>
142 <xsl:when test="self::xref">
143 <xsl:choose>
144 <xsl:when test="contains(concat(' ',normalize-space($list),' '),
145 concat(' ',@linkend,' '))">
146 <xsl:choose>
147 <xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
148 <xref linkend="xorg7-server"/>
149 </xsl:when>
150 <xsl:when test="@linkend='server-mail'">
151 <xref linkend="{$MTA}"/>
152 </xsl:when>
153 <xsl:otherwise>
154 <xsl:copy-of select="."/>
155 </xsl:otherwise>
156 </xsl:choose>
157 </xsl:when>
158 <xsl:otherwise>
159 <xsl:choose>
160 <xsl:when test="@linkend='bootscripts' or
161 @linkend='systemd-units'">
162 <xsl:copy-of select="."/>
163 </xsl:when>
164 <xsl:otherwise>
165 <xsl:value-of select="@linkend"/> (in full book)
166 </xsl:otherwise>
167 </xsl:choose>
168 </xsl:otherwise>
169 </xsl:choose>
170 </xsl:when>
171 <xsl:when test="@id">
172 <xsl:element name="{name()}">
173 <xsl:for-each select="attribute::*">
174 <xsl:attribute name="{name()}">
175 <xsl:value-of select="."/>
176 <xsl:if test="name() = 'id'">-pass1</xsl:if>
177 </xsl:attribute>
178 </xsl:for-each>
179 <xsl:apply-templates mode="pass1"/>
180 </xsl:element>
181 </xsl:when>
182 <xsl:when test=".//xref | .//@id">
183 <xsl:element name="{name()}">
184 <xsl:for-each select="attribute::*">
185 <xsl:attribute name="{name()}">
186 <xsl:value-of select="."/>
187 </xsl:attribute>
188 </xsl:for-each>
189 <xsl:apply-templates mode="pass1"/>
190 </xsl:element>
191 </xsl:when>
192 <xsl:otherwise>
193 <xsl:copy-of select="."/>
194 </xsl:otherwise>
195 </xsl:choose>
196 </xsl:template>
197
198 <xsl:template match="*" mode="pass1-sect2">
199 <xsl:choose>
200 <xsl:when test="self::sect2">
201 <xsl:element name="sect1">
202 <xsl:attribute name="id"><xsl:value-of select="@id"/>-pass1</xsl:attribute>
203 <xsl:attribute name="xreflabel"><xsl:value-of select="@xreflabel"/></xsl:attribute>
204 <xsl:processing-instruction name="dbhtml">filename="<xsl:value-of
205 select="@id"/>-pass1.html"</xsl:processing-instruction>
206 <xsl:apply-templates mode="pass1-sect2"/>
207 </xsl:element>
208 </xsl:when>
209 <xsl:when test="self::sect3">
210 <xsl:element name="sect2">
211 <xsl:attribute name="role">
212 <xsl:value-of select="@role"/>
213 </xsl:attribute>
214 <xsl:apply-templates mode="pass1-sect2"/>
215 </xsl:element>
216 </xsl:when>
217 <xsl:when test="self::bridgehead">
218 <xsl:element name="bridgehead">
219 <xsl:attribute name="renderas">
220 <xsl:if test="@renderas='sect4'">sect3</xsl:if>
221 <xsl:if test="@renderas='sect5'">sect4</xsl:if>
222 </xsl:attribute>
223 <xsl:value-of select='.'/>
224 </xsl:element>
225 </xsl:when>
226 <xsl:when test="self::xref">
227 <xsl:choose>
228 <xsl:when test="contains(concat(' ',normalize-space($list),' '),
229 concat(' ',@linkend,' '))">
230 <xsl:choose>
231 <xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
232 <xref linkend="xorg7-server"/>
233 </xsl:when>
234 <xsl:when test="@linkend='server-mail'">
235 <xref linkend="{$MTA}"/>
236 </xsl:when>
237 <xsl:otherwise>
238 <xsl:copy-of select="."/>
239 </xsl:otherwise>
240 </xsl:choose>
241 </xsl:when>
242 <xsl:otherwise>
243 <xsl:choose>
244 <xsl:when test="@linkend='bootscripts' or
245 @linkend='systemd-units'">
246 <xsl:copy-of select="."/>
247 </xsl:when>
248 <xsl:otherwise>
249 <xsl:value-of select="@linkend"/> (in full book)
250 </xsl:otherwise>
251 </xsl:choose>
252 </xsl:otherwise>
253 </xsl:choose>
254 </xsl:when>
255 <xsl:when test="@id">
256 <xsl:element name="{name()}">
257 <xsl:for-each select="attribute::*">
258 <xsl:attribute name="{name()}">
259 <xsl:value-of select="."/>
260 <xsl:if test="name() = 'id'">-pass1</xsl:if>
261 </xsl:attribute>
262 </xsl:for-each>
263 <xsl:apply-templates mode="pass1-sect2"/>
264 </xsl:element>
265 </xsl:when>
266 <xsl:when test=".//xref | .//@id">
267 <xsl:element name="{name()}">
268 <xsl:for-each select="attribute::*">
269 <xsl:attribute name="{name()}">
270 <xsl:value-of select="."/>
271 </xsl:attribute>
272 </xsl:for-each>
273 <xsl:apply-templates mode="pass1-sect2"/>
274 </xsl:element>
275 </xsl:when>
276 <xsl:otherwise>
277 <xsl:copy-of select="."/>
278 </xsl:otherwise>
279 </xsl:choose>
280 </xsl:template>
281
282 <xsl:template match="processing-instruction()" mode="pass1">
283 <xsl:variable name="pi-full" select="string()"/>
284 <xsl:variable name="pi-value"
285 select="substring-after($pi-full,'filename=')"/>
286 <xsl:variable name="filename"
287 select="substring-before(substring($pi-value,2),'.html')"/>
288 <xsl:processing-instruction name="dbhtml">filename="<xsl:copy-of
289 select="$filename"/>-pass1.html"</xsl:processing-instruction>
290 </xsl:template>
291
292 <xsl:template match="processing-instruction()" mode="sect1">
293 <xsl:copy-of select="."/>
294 </xsl:template>
295
296<!-- Any node which has no xref descendant is copied verbatim. If there
297 is an xref descendant, output the node and recurse. -->
298 <xsl:template match="*" mode="sect1">
299 <xsl:choose>
300 <xsl:when test="self::xref">
301 <xsl:choose>
302 <xsl:when test="contains(concat(' ',normalize-space($list),' '),
303 concat(' ',@linkend,' '))">
304 <xsl:choose>
305 <xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
306 <xref linkend="xorg7-server"/>
307 </xsl:when>
308 <xsl:when test="@linkend='server-mail'">
309 <xref linkend="{$MTA}"/>
310 </xsl:when>
311 <xsl:otherwise>
312 <xsl:copy-of select="."/>
313 </xsl:otherwise>
314 </xsl:choose>
315 </xsl:when>
316 <xsl:otherwise>
317 <xsl:choose>
318 <xsl:when test="@linkend='bootscripts' or
319 @linkend='systemd-units'">
320 <xsl:copy-of select="."/>
321 </xsl:when>
322 <xsl:otherwise>
323 <xsl:value-of select="@linkend"/> (in full book)
324 </xsl:otherwise>
325 </xsl:choose>
326 </xsl:otherwise>
327 </xsl:choose>
328 </xsl:when>
329 <xsl:when test=".//xref">
330 <xsl:element name="{name()}">
331 <xsl:for-each select="attribute::*">
332 <xsl:attribute name="{name()}">
333 <xsl:value-of select="."/>
334 </xsl:attribute>
335 </xsl:for-each>
336 <xsl:apply-templates mode="sect1"/>
337 </xsl:element>
338 </xsl:when>
339 <xsl:otherwise>
340 <xsl:copy-of select="."/>
341 </xsl:otherwise>
342 </xsl:choose>
343 </xsl:template>
344
345<!-- Python modules and DBus bindings -->
346 <xsl:template match="sect2">
347 <xsl:apply-templates select='.' mode="sect2"/>
348 </xsl:template>
349
350 <xsl:template match="*" mode="sect2">
351 <xsl:choose>
352 <xsl:when test="self::sect2">
353 <xsl:element name="sect1">
354 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
355 <xsl:attribute name="xreflabel"><xsl:value-of select="@xreflabel"/></xsl:attribute>
356 <xsl:processing-instruction name="dbhtml">filename="<xsl:value-of
357 select="@id"/>.html"</xsl:processing-instruction>
358 <xsl:apply-templates mode="sect2"/>
359 </xsl:element>
360 </xsl:when>
361 <xsl:when test="self::sect3">
362 <xsl:element name="sect2">
363 <xsl:attribute name="role">
364 <xsl:value-of select="@role"/>
365 </xsl:attribute>
366 <xsl:apply-templates mode="sect2"/>
367 </xsl:element>
368 </xsl:when>
369 <xsl:when test="self::bridgehead">
370 <xsl:element name="bridgehead">
371 <xsl:attribute name="renderas">
372 <xsl:if test="@renderas='sect4'">sect3</xsl:if>
373 <xsl:if test="@renderas='sect5'">sect4</xsl:if>
374 </xsl:attribute>
375 <xsl:value-of select='.'/>
376 </xsl:element>
377 </xsl:when>
378 <xsl:when test="self::xref">
379 <xsl:choose>
380 <xsl:when test="contains(concat(' ',normalize-space($list),' '),
381 concat(' ',@linkend,' '))">
382 <xsl:choose>
383 <xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
384 <xref linkend="xorg7-server"/>
385 </xsl:when>
386 <xsl:when test="@linkend='server-mail'">
387 <xref linkend="{$MTA}"/>
388 </xsl:when>
389 <xsl:otherwise>
390 <xsl:copy-of select="."/>
391 </xsl:otherwise>
392 </xsl:choose>
393 </xsl:when>
394 <xsl:otherwise>
395 <xsl:value-of select="@linkend"/> (in full book)
396 </xsl:otherwise>
397 </xsl:choose>
398 </xsl:when>
399 <xsl:when test=".//xref">
400 <xsl:element name="{name()}">
401 <xsl:for-each select="attribute::*">
402 <xsl:attribute name="{name()}">
403 <xsl:value-of select="."/>
404 </xsl:attribute>
405 </xsl:for-each>
406 <xsl:apply-templates mode="sect2"/>
407 </xsl:element>
408 </xsl:when>
409 <xsl:otherwise>
410 <xsl:copy-of select="."/>
411 </xsl:otherwise>
412 </xsl:choose>
413 </xsl:template>
414
415<!-- Perl modules : transform them to minimal sect1. Use a template
416 for installation instructions -->
417 <xsl:template match="bridgehead">
418 <xsl:if test="ancestor::sect1[@id='perl-modules']">
419 <xsl:element name="sect1">
420 <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
421 <xsl:attribute name="xreflabel"><xsl:value-of select="./@xreflabel"/></xsl:attribute>
422 <xsl:processing-instruction name="dbhtml">
423 filename="<xsl:value-of select="@id"/>.html"</xsl:processing-instruction>
424 <title><xsl:value-of select="./@xreflabel"/></title>
425 <sect2 role="package">
426 <title>Introduction to <xsl:value-of select="@id"/></title>
427 <bridgehead renderas="sect3">Package Information</bridgehead>
428 <itemizedlist spacing="compact">
429 <listitem>
430 <para>Download (HTTP): <xsl:copy-of select="./following-sibling::itemizedlist[1]/listitem/para/ulink"/></para>
431 </listitem>
432 <listitem>
433 <para>Download (FTP): <ulink url=" "/></para>
434 </listitem>
435 </itemizedlist>
436 </sect2>
437 <xsl:choose>
438 <xsl:when test="following-sibling::itemizedlist[1]//xref[@linkend='perl-standard-install'] | following-sibling::itemizedlist[1]/preceding-sibling::para//xref[@linkend='perl-standard-install']">
439 <xsl:apply-templates mode="perl-install" select="id('perl-standard-install')"/>
440 </xsl:when>
441 <xsl:otherwise>
442 <sect2 role="installation">
443 <title>Installation of <xsl:value-of select="@xreflabel"/></title>
444 <para>Run the following commands:</para>
445 <for-each select="following-sibling::bridgehead/preceding-sibling::screen[not(@role)]">
446 <xsl:copy-of select="."/>
447 </for-each>
448 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
449 <for-each select="following-sibling::bridgehead/preceding-sibling::screen[@role='root']">
450 <xsl:copy-of select="."/>
451 </for-each>
452 </sect2>
453 </xsl:otherwise>
454 </xsl:choose>
455 </xsl:element>
456 </xsl:if>
457 </xsl:template>
458
459<!-- The case of depdendencies of perl modules. Same treatment
460 as for perl modules. Just easier because always perl standard -->
461 <xsl:template match="para">
462 <xsl:element name="sect1">
463 <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
464 <xsl:attribute name="xreflabel"><xsl:value-of select="./@xreflabel"/></xsl:attribute>
465 <xsl:processing-instruction name="dbhtml">filename="<xsl:value-of
466 select="@id"/>.html"</xsl:processing-instruction>
467 <title><xsl:value-of select="./@xreflabel"/></title>
468 <sect2 role="package">
469 <title>Introduction to <xsl:value-of select="@id"/></title>
470 <bridgehead renderas="sect3">Package Information</bridgehead>
471 <itemizedlist spacing="compact">
472 <listitem>
473 <para>Download (HTTP): <xsl:copy-of select="./ulink"/></para>
474 </listitem>
475 <listitem>
476 <para>Download (FTP): <ulink url=" "/></para>
477 </listitem>
478 </itemizedlist>
479 </sect2>
480 <xsl:apply-templates mode="perl-install" select="id('perl-standard-install')"/>
481 </xsl:element>
482 </xsl:template>
483
484<!-- copy of the perl standard installation instructions:
485 suppress id (otherwise not unique) and note (which we
486 do not want to apply -->
487 <xsl:template match="sect2" mode="perl-install">
488 <sect2 role="installation">
489 <xsl:for-each select="./*">
490 <xsl:if test="not(self::note)">
491 <xsl:copy-of select="."/>
492 </xsl:if>
493 </xsl:for-each>
494 </sect2>
495 </xsl:template>
496
497<!-- we have got an xorg package. We are at the installation page
498 but now we need to make an autonomous page from the global
499 one -->
500 <xsl:template match="sect1" mode="xorg">
501 <xsl:param name="package"/>
502 <xsl:variable name="tarball">
503 <xsl:call-template name="tarball">
504 <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
505 <xsl:with-param name="cat-md5"
506 select="string(.//userinput[starts-with(string(),'cat ')])"/>
507 </xsl:call-template>
508 </xsl:variable>
509 <xsl:variable name="md5sum">
510 <xsl:call-template name="md5sum">
511 <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
512 <xsl:with-param name="cat-md5"
513 select=".//userinput[starts-with(string(),'cat ')]"/>
514 </xsl:call-template>
515 </xsl:variable>
516 <xsl:variable name="download-dir">
517 <xsl:call-template name="download-dir">
518 <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
519 <xsl:with-param name="cat-md5"
520 select=".//userinput[starts-with(string(),'cat ')]"/>
521 </xsl:call-template>
522 </xsl:variable>
523 <xsl:variable name="install-instructions">
524 <xsl:call-template name="inst-instr">
525 <xsl:with-param name="inst-instr"
526 select=".//userinput[starts-with(string(),'for ')]"/>
527 </xsl:call-template>
528 </xsl:variable>
529 <xsl:element name="sect1">
530 <xsl:attribute name="id"><xsl:value-of select="$package"/></xsl:attribute>
531 <xsl:processing-instruction name="dbhtml">
532 filename="<xsl:value-of select='$package'/>.html"
533 </xsl:processing-instruction>
534 <title><xsl:value-of select="$package"/></title>
535 <sect2 role="package">
536 <title>Introduction to <xsl:value-of select="$package"/></title>
537 <bridgehead renderas="sect3">Package Information</bridgehead>
538 <itemizedlist spacing="compact">
539 <listitem>
540 <para>Download (HTTP): <xsl:element name="ulink">
541 <xsl:attribute name="url">
542 <xsl:value-of
543 select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
544 <xsl:value-of select="$download-dir"/>
545 <xsl:value-of select="$tarball"/>
546 </xsl:attribute>
547 </xsl:element>
548 </para>
549 </listitem>
550 <listitem>
551 <para>Download (FTP): <xsl:element name="ulink">
552 <xsl:attribute name="url">
553 <xsl:value-of
554 select=".//para[contains(string(),'(FTP)')]/ulink/@url"/>
555 <xsl:value-of select="$download-dir"/>
556 <xsl:value-of select="$tarball"/>
557 </xsl:attribute>
558 </xsl:element>
559 </para>
560 </listitem>
561 <listitem>
562 <para>
563 Download MD5 sum: <xsl:value-of select="$md5sum"/>
564 </para>
565 </listitem>
566 </itemizedlist>
567 <!-- If there is an additional download, we need to output that -->
568 <xsl:if test=".//bridgehead[contains(string(),'Additional')]">
569 <xsl:copy-of
570 select=".//bridgehead[contains(string(),'Additional')]"/>
571 <xsl:copy-of
572 select=".//bridgehead[contains(string(),'Additional')]
573 /following-sibling::itemizedlist[1]"/>
574 </xsl:if>
575 </sect2>
576 <sect2 role="installation">
577 <title>Installation of <xsl:value-of select="$package"/></title>
578
579 <para>
580 Install <application><xsl:value-of select="$package"/></application>
581 by running the following commands:
582 </para>
583
584 <screen><userinput>packagedir=<xsl:value-of
585 select="substring-before($tarball,'.tar.bz2')"/>
586 <xsl:text>&#xA;</xsl:text>
587 <xsl:value-of select="substring-before($install-instructions,
588 'as_root')"/>
589 </userinput></screen>
590
591 <para>
592 Now as the <systemitem class="username">root</systemitem> user:
593 </para>
594 <screen role='root'>
595 <userinput><xsl:value-of select="substring-after(
596 $install-instructions,
597 'as_root')"/>
598 </userinput>
599 </screen>
600 </sect2>
601 </xsl:element><!-- sect1 -->
602
603 </xsl:template>
604
605<!-- get the tarball name from the text that comes from the .md5 file -->
606 <xsl:template name="tarball">
607 <xsl:param name="package"/>
608 <xsl:param name="cat-md5"/>
609<!-- DEBUG
610<xsl:message><xsl:text>Entering "tarball" template:
611 package is: </xsl:text>
612<xsl:value-of select="$package"/><xsl:text>
613 cat-md5 is: </xsl:text>
614<xsl:value-of select="$cat-md5"/>
615</xsl:message>
616END DEBUG -->
617 <xsl:choose>
618 <xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
619 <xsl:call-template name="tarball">
620 <xsl:with-param name="package" select="$package"/>
621 <xsl:with-param name="cat-md5"
622 select="substring-after($cat-md5,'&#xA;')"/>
623 </xsl:call-template>
624 </xsl:when>
625 <xsl:when test="contains(substring-before($cat-md5,$package),' ')">
626 <xsl:call-template name="tarball">
627 <xsl:with-param name="package" select="$package"/>
628 <xsl:with-param name="cat-md5"
629 select="substring-after($cat-md5,' ')"/>
630 </xsl:call-template>
631 </xsl:when>
632 <xsl:otherwise>
633 <xsl:copy-of select="substring-after(
634 substring-before($cat-md5,'&#xA;'),' ')"/>
635 </xsl:otherwise>
636 </xsl:choose>
637 </xsl:template>
638<!-- get the download dirname from the text that comes from the .md5 file -->
639 <xsl:template name="download-dir">
640 <xsl:param name="package"/>
641 <xsl:param name="cat-md5"/>
642 <xsl:choose>
643 <xsl:when test="not(@id='xorg7-legacy')">
644 <xsl:copy-of select="''"/>
645 </xsl:when>
646 <xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
647 <xsl:call-template name="download-dir">
648 <xsl:with-param name="package" select="$package"/>
649 <xsl:with-param name="cat-md5"
650 select="substring-after($cat-md5,'&#xA;')"/>
651 </xsl:call-template>
652 </xsl:when>
653 <xsl:when test="contains(substring-before($cat-md5,$package),' ')">
654 <xsl:call-template name="download-dir">
655 <xsl:with-param name="package" select="$package"/>
656 <xsl:with-param name="cat-md5"
657 select="substring-after($cat-md5,' ')"/>
658 </xsl:call-template>
659 </xsl:when>
660 <xsl:otherwise>
661 <xsl:copy-of select="substring-before($cat-md5,' ')"/>
662 </xsl:otherwise>
663 </xsl:choose>
664 </xsl:template>
665<!-- same for md5sum -->
666 <xsl:template name="md5sum">
667 <xsl:param name="package"/>
668 <xsl:param name="cat-md5"/>
669 <xsl:choose>
670 <xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
671 <xsl:call-template name="md5sum">
672 <xsl:with-param name="package" select="$package"/>
673 <xsl:with-param name="cat-md5"
674 select="substring-after($cat-md5,'&#xA;')"/>
675 </xsl:call-template>
676 </xsl:when>
677 <xsl:otherwise>
678 <xsl:copy-of select="substring-before($cat-md5,' ')"/>
679 </xsl:otherwise>
680 </xsl:choose>
681 </xsl:template>
682
683 <xsl:template name="inst-instr">
684 <xsl:param name="inst-instr"/>
685 <xsl:choose>
686 <xsl:when test="contains($inst-instr,'pushd')">
687 <xsl:call-template name="inst-instr">
688 <xsl:with-param name="inst-instr"
689 select="substring-after(
690 substring-after($inst-instr,'pushd'),
691 '&#xA;')"/>
692 </xsl:call-template>
693 </xsl:when>
694 <xsl:otherwise>
695 <xsl:copy-of select="substring-before($inst-instr,'popd')"/>
696 </xsl:otherwise>
697 </xsl:choose>
698 </xsl:template>
699</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.