2013-10-29 16:42:03 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
|
2017-03-12 14:20:02 +01:00
|
|
|
<!-- $Id$ -->
|
2013-10-29 16:42:03 +01:00
|
|
|
<!-- Takes the blfs-full.xml file and extract a list
|
|
|
|
of packages obeying packdesc.dtd + looks for already
|
|
|
|
installed packages in the tracking file (stringparam
|
|
|
|
'installed-packages') -->
|
2017-08-09 15:55:55 +02:00
|
|
|
<!-- Extract also a list of LFS packages from stringparam lfs-full -->
|
2013-10-29 16:42:03 +01:00
|
|
|
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
version="1.0">
|
|
|
|
|
2017-08-09 15:55:55 +02:00
|
|
|
<xsl:param name="lfs-full" select="'./lfs-xml/lfs-full.xml'"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:param name="installed-packages" select="'../lib/instpkg.xml'"/>
|
|
|
|
|
|
|
|
<xsl:output method="xml"
|
|
|
|
encoding='ISO-8859-1'
|
|
|
|
doctype-system="./packdesc.dtd"/>
|
|
|
|
|
|
|
|
<!-- specialCases.xsl is generated by a shell script:
|
|
|
|
allows for cases where version begins with a letter
|
|
|
|
and when there is no version (such as xorg7 packages) -->
|
|
|
|
<xsl:include href="./specialCases.xsl"/>
|
|
|
|
|
|
|
|
<xsl:template match="/">
|
|
|
|
<princList>
|
2017-08-09 15:55:55 +02:00
|
|
|
<xsl:text>

 </xsl:text>
|
|
|
|
<list>
|
|
|
|
<xsl:attribute name="id">lfs</xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<name>LFS Packages</name>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<sublist>
|
|
|
|
<xsl:attribute name="id">lfs-6</xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<name>LFS Chapter 6</name>
|
|
|
|
<xsl:apply-templates
|
|
|
|
select='document($lfs-full)//
|
|
|
|
chapter[@id="chapter-building-system"]/
|
|
|
|
sect1/sect1info'/>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
</sublist>
|
|
|
|
<sublist>
|
|
|
|
<xsl:attribute name="id">lfs-8</xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<name>LFS Chapter 8</name>
|
|
|
|
<xsl:apply-templates select='document($lfs-full)//chapter[@id="chapter-bootable"]/sect1/sect1info[./productname="linux"]'/>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
</sublist>
|
|
|
|
<sublist>
|
|
|
|
<xsl:attribute name="id">lfs-9</xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<name>LFS Chapter 9</name>
|
|
|
|
<xsl:apply-templates select='document($lfs-full)//sect1[@id="ch-finish-theend"]//userinput[starts-with(string(),"echo")]'/>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
</sublist>
|
|
|
|
<xsl:text>

 </xsl:text>
|
|
|
|
</list>
|
2013-10-29 16:42:03 +01:00
|
|
|
<!-- How to have blfs-bootscripts versionned? Do not know, so
|
|
|
|
avoid it (TODO ?) -->
|
|
|
|
<xsl:apply-templates select="//part[not(@id='introduction')]"/>
|
|
|
|
</princList>
|
|
|
|
</xsl:template>
|
|
|
|
|
2017-08-09 15:55:55 +02:00
|
|
|
<xsl:template match="userinput">
|
|
|
|
<!-- Only used in lFS chapter 9, to retrieve book version -->
|
|
|
|
<package>
|
|
|
|
<name>LFS-Release</name>
|
|
|
|
<xsl:element name="version">
|
|
|
|
<xsl:copy-of select="substring-after(substring-before(string(),' >'),'echo ')"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:if
|
|
|
|
test="document($installed-packages)//package[name='LFS-Release']">
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="inst-version">
|
|
|
|
<xsl:value-of
|
|
|
|
select="document(
|
|
|
|
$installed-packages
|
|
|
|
)//package[name='LFS-Release']/version"/>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:if>
|
|
|
|
</package>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="sect1info">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- Never update linux headers -->
|
|
|
|
<xsl:when test="./productname='linux'
|
|
|
|
and ancestor::chapter[@id='chapter-building-system']"/>
|
|
|
|
<!-- Gcc version is taken from BLFS -->
|
|
|
|
<xsl:when test="./productname='gcc'"/>
|
|
|
|
<!-- Shadow version is taken from BLFS -->
|
|
|
|
<xsl:when test="./productname='shadow'"/>
|
2017-09-14 19:04:16 +02:00
|
|
|
<!-- Vim version is taken from BLFS -->
|
|
|
|
<xsl:when test="./productname='vim'"/>
|
2017-08-09 15:55:55 +02:00
|
|
|
<!-- Dbus version is taken from BLFS -->
|
|
|
|
<xsl:when test="./productname='dbus'"/>
|
|
|
|
<!-- Systemd version is taken from BLFS -->
|
|
|
|
<xsl:when test="./productname='systemd'"/>
|
2017-10-07 10:17:57 +02:00
|
|
|
<!-- Same for python and ninja -->
|
|
|
|
<xsl:when test="./productname='ninja'"/>
|
|
|
|
<xsl:when test="./productname='Python'"/>
|
2017-08-09 15:55:55 +02:00
|
|
|
<xsl:otherwise>
|
|
|
|
<package><xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
|
|
|
<xsl:value-of select="./productname"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="version">
|
|
|
|
<xsl:value-of select="./productnumber"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:if
|
|
|
|
test="document($installed-packages)//package[name=current()/productname]">
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="inst-version">
|
|
|
|
<xsl:value-of
|
|
|
|
select="document(
|
|
|
|
$installed-packages
|
|
|
|
)//package[name=current()/productname]/version"/>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:if>
|
|
|
|
</package>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<!-- No deps for now: a former version is always installed -->
|
|
|
|
</xsl:template>
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:template match="part">
|
|
|
|
<xsl:if test="count(.//*[contains(translate(@xreflabel,
|
|
|
|
'123456789',
|
|
|
|
'000000000'),
|
|
|
|
'-0')
|
|
|
|
]) > 0">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<list>
|
|
|
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
2016-08-24 17:21:49 +02:00
|
|
|
<xsl:value-of select="normalize-space(title)"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
</xsl:element>
|
|
|
|
<xsl:text>

</xsl:text>
|
|
|
|
<xsl:apply-templates select="chapter"/>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
</list>
|
|
|
|
<xsl:text>

</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="chapter">
|
|
|
|
<xsl:if test="count(.//*[contains(translate(@xreflabel,
|
|
|
|
'123456789',
|
|
|
|
'000000000'),
|
|
|
|
'-0')
|
|
|
|
]) > 0">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<sublist>
|
|
|
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
2016-08-24 17:21:49 +02:00
|
|
|
<xsl:value-of select="normalize-space(title)"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
</xsl:element>
|
|
|
|
<xsl:text>
</xsl:text>
|
2015-11-18 11:54:13 +01:00
|
|
|
<xsl:apply-templates select=".//sect1">
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:sort select="@id"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
</sublist><xsl:text>

</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="sect1">
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- This test is to find sections containing modules (PERL, Python
|
|
|
|
DBus,...) -->
|
|
|
|
<xsl:when
|
|
|
|
test="not(contains(translate(@xreflabel,
|
|
|
|
'123456789',
|
|
|
|
'000000000'),
|
|
|
|
'-0')) and
|
|
|
|
count(descendant::node()[contains(translate(@xreflabel,
|
|
|
|
'123456789',
|
|
|
|
'000000000'),
|
|
|
|
'-0')
|
|
|
|
]) > 0">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<package><xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
2016-08-24 17:21:49 +02:00
|
|
|
<xsl:value-of select="normalize-space(title)"/>
|
2017-08-09 15:32:22 +02:00
|
|
|
</xsl:element>
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:text>
</xsl:text>
|
2015-11-18 11:54:13 +01:00
|
|
|
<!-- Do not use .//*, which would include self. -->
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:apply-templates
|
|
|
|
select="descendant::node()[contains(translate(@xreflabel,
|
|
|
|
'123456789',
|
|
|
|
'000000000'),
|
|
|
|
'-0')
|
|
|
|
]"
|
2015-11-18 11:54:13 +01:00
|
|
|
mode="normal">
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:sort select="@id"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
</package><xsl:text>

</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<!-- Calls the template of specialCases.xsl,
|
|
|
|
which calls the "normal" template when the
|
|
|
|
case is normal. -->
|
|
|
|
<xsl:apply-templates select='.' mode="special">
|
|
|
|
<xsl:sort select="@id"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="*" mode="normal">
|
|
|
|
<xsl:variable name="version">
|
|
|
|
<xsl:call-template name="version">
|
|
|
|
<xsl:with-param name="label" select="./@xreflabel"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- If there is a "sect1" ancestor, this means that
|
|
|
|
we have a module -->
|
|
|
|
<xsl:when test="ancestor::sect1">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<module><xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
|
|
|
<xsl:value-of select="./@id"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="version">
|
|
|
|
<xsl:value-of select="$version"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:if
|
|
|
|
test="document($installed-packages)//package[name=current()/@id]">
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="inst-version">
|
|
|
|
<xsl:value-of
|
|
|
|
select="document(
|
|
|
|
$installed-packages
|
|
|
|
)//package[name=current()/@id]/version"/>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- Dependencies -->
|
|
|
|
<!-- First the case of python modules or d-bus bindings -->
|
|
|
|
<xsl:if test="self::sect2">
|
|
|
|
<!-- dependencies -->
|
|
|
|
<xsl:apply-templates select=".//para[@role='required' or
|
|
|
|
@role='recommended' or
|
|
|
|
@role='optional']"
|
|
|
|
mode="dependency"/>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- For python modules, the preceding module is an optional dep -->
|
|
|
|
<xsl:if test="ancestor::sect1[@id='python-modules']">
|
|
|
|
<xsl:apply-templates
|
|
|
|
select="preceding-sibling::sect2[@role='package']
|
|
|
|
//listitem[para/xref/@linkend=current()/@id]"
|
|
|
|
mode="prec-dep"/>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- Now the case of perl modules: let us test our XSLT abilities.
|
|
|
|
Well, "use the sibling, Luke" -->
|
|
|
|
<xsl:if test="self::bridgehead">
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist[1]
|
|
|
|
/listitem/itemizedlist/listitem"
|
|
|
|
mode="perlmod-dep">
|
|
|
|
<xsl:sort select="position()"
|
|
|
|
data-type="number"
|
|
|
|
order="descending"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- End dependencies -->
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
</module><xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<package><xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="name">
|
|
|
|
<xsl:value-of select="./@id"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="version">
|
|
|
|
<xsl:value-of select="$version"/>
|
|
|
|
</xsl:element>
|
|
|
|
<xsl:if
|
|
|
|
test="document($installed-packages)//package[name=current()/@id]">
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
<xsl:element name="inst-version">
|
|
|
|
<xsl:value-of
|
|
|
|
select="document(
|
|
|
|
$installed-packages
|
|
|
|
)//package[name=current()/@id]/version"/>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:if>
|
|
|
|
<!-- Dependencies -->
|
2013-12-28 21:51:15 +01:00
|
|
|
<!-- If in Xorg (not anymore) or KDE chapter, consider that the preceding
|
|
|
|
package is the first dependency (not always noted in the book)-->
|
2015-02-22 22:20:37 +01:00
|
|
|
<xsl:if test="ancestor::chapter[@id='kde4-core'
|
|
|
|
or @id='xfce-core'
|
2015-09-27 14:52:55 +02:00
|
|
|
or @id='lxqt-desktop'
|
2015-02-22 22:20:37 +01:00
|
|
|
or @id='lxde-desktop']
|
|
|
|
and preceding-sibling::sect1[1]">
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
2013-12-28 21:51:15 +01:00
|
|
|
<xsl:element name="dependency">
|
|
|
|
<xsl:attribute name="status">required</xsl:attribute>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:attribute name="build">before</xsl:attribute>
|
2013-12-28 21:51:15 +01:00
|
|
|
<xsl:attribute name="name">
|
|
|
|
<xsl:value-of select="preceding-sibling::sect1[1]/@id"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="type">ref</xsl:attribute>
|
|
|
|
</xsl:element>
|
2013-10-29 16:42:03 +01:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates select=".//para[@role='required' or
|
|
|
|
@role='recommended' or
|
|
|
|
@role='optional']"
|
|
|
|
mode="dependency"/>
|
|
|
|
<!-- End dependencies -->
|
|
|
|
<xsl:text>
 </xsl:text>
|
|
|
|
</package><xsl:text>
</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="version">
|
|
|
|
<xsl:param name="label" select="abc-2"/>
|
|
|
|
<xsl:variable name="start" select="string-length(substring-before(translate($label,'123456789','000000000'),'-0'))+2"/>
|
|
|
|
<xsl:variable name="prelim-ver" select="substring($label,$start)"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($prelim-ver,'onfiguration')"/>
|
|
|
|
<xsl:when test="contains($prelim-ver,'escription')"/>
|
|
|
|
<xsl:when test="contains($prelim-ver,'EggDBus')">
|
|
|
|
<xsl:value-of select="substring-before($prelim-ver,' (EggDBus)')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains($label,'JDK')">
|
|
|
|
<xsl:value-of select="translate($prelim-ver,' ','_')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$prelim-ver"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="para" mode="dependency">
|
|
|
|
<xsl:variable name="status" select="./@role"/>
|
2015-11-21 09:46:54 +01:00
|
|
|
<!-- First internal dependencies -->
|
2016-12-03 19:22:50 +01:00
|
|
|
<xsl:for-each select=".//xref">
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:choose>
|
2014-03-23 20:13:33 +01:00
|
|
|
<!-- Avoid depending of myself -->
|
|
|
|
<xsl:when test="ancestor::*[@id=current()/@linkend]"/>
|
2017-10-07 20:48:02 +02:00
|
|
|
<!-- do not depend on something which is not a dependency -->
|
|
|
|
<xsl:when test="@role='nodep'"/>
|
2014-03-23 20:13:33 +01:00
|
|
|
<!-- Call list expansion when we have an xorg7 series of packages -->
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:when test="contains(@linkend,'xorg7-')">
|
|
|
|
<xsl:call-template name="expand-deps">
|
|
|
|
<xsl:with-param name="section">
|
|
|
|
<xsl:value-of select="@linkend"/>
|
|
|
|
</xsl:with-param>
|
|
|
|
<xsl:with-param name="status">
|
|
|
|
<xsl:value-of select="$status"/>
|
|
|
|
</xsl:with-param>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:with-param name="build">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@role='runtime'">after</xsl:when>
|
|
|
|
<xsl:otherwise>before</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:with-param>
|
2013-10-29 16:42:03 +01:00
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:element name="dependency">
|
|
|
|
<xsl:attribute name="status">
|
|
|
|
<xsl:value-of select="$status"/>
|
|
|
|
</xsl:attribute>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:attribute name="build">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@role='runtime'">after</xsl:when>
|
|
|
|
<xsl:otherwise>before</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:attribute>
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:attribute name="name">
|
|
|
|
<xsl:value-of select="@linkend"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="type">ref</xsl:attribute>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:for-each>
|
2015-11-21 09:46:54 +01:00
|
|
|
<!-- then external dependencies -->
|
2016-12-03 19:22:50 +01:00
|
|
|
<xsl:for-each select=".//ulink">
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<!-- do not depend on something which is not a dependency -->
|
|
|
|
<xsl:when test="@role='nodep'"/>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>
|
2015-11-21 09:46:54 +01:00
|
|
|
</xsl:text>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:element name="dependency">
|
|
|
|
<xsl:attribute name="status">
|
|
|
|
<xsl:value-of select="$status"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="build">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@role='runtime'">after</xsl:when>
|
|
|
|
<xsl:otherwise>before</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="name">
|
|
|
|
<xsl:value-of select="translate(normalize-space(text()),' /,()','-----')"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="type">link</xsl:attribute>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2015-11-21 09:46:54 +01:00
|
|
|
</xsl:for-each>
|
2013-10-29 16:42:03 +01:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="listitem" mode="prec-dep">
|
|
|
|
<xsl:if test="preceding-sibling::listitem">
|
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:element name="dependency">
|
|
|
|
<!-- the dep on the preceding package used to be required for python.
|
|
|
|
It seems optional now -->
|
|
|
|
<xsl:attribute name="status">optional</xsl:attribute>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:attribute name="build">before</xsl:attribute>
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:attribute name="name">
|
|
|
|
<xsl:value-of select="preceding-sibling::listitem[1]//@linkend"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="type">ref</xsl:attribute>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="listitem" mode="perlmod-dep">
|
|
|
|
<xsl:param name="glue" select="'
 '"/>
|
|
|
|
<xsl:choose>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:when test="para/xref[not(@role) or @role != 'nodep']|para[@id]/ulink">
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:value-of select="$glue"/>
|
|
|
|
<xsl:element name="dependency">
|
|
|
|
<xsl:attribute name="status">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when
|
|
|
|
test="count(./para/text()[contains(string(),
|
|
|
|
'ptional')
|
|
|
|
]
|
|
|
|
)>0">optional</xsl:when>
|
|
|
|
<xsl:otherwise>required</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:attribute>
|
2017-10-07 20:48:02 +02:00
|
|
|
<xsl:attribute name="build">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="para/xref/@role='runtime'">after</xsl:when>
|
|
|
|
<xsl:when test="para/ulink/@role='runtime'">after</xsl:when>
|
|
|
|
<xsl:otherwise>before</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:attribute>
|
2013-10-29 16:42:03 +01:00
|
|
|
<xsl:attribute name="name">
|
|
|
|
<xsl:if test="para/xref">
|
|
|
|
<xsl:value-of select="para/xref/@linkend"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="para/ulink">
|
|
|
|
<xsl:value-of select="para/@id"/>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="type">
|
|
|
|
<xsl:if test="para/xref">ref</xsl:if>
|
|
|
|
<xsl:if test="para/ulink">link</xsl:if>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:apply-templates select="itemizedlist/listitem"
|
|
|
|
mode="perlmod-dep">
|
|
|
|
<xsl:sort select="position()"
|
|
|
|
data-type="number"
|
|
|
|
order="descending"/>
|
|
|
|
<xsl:with-param name="glue" select="concat($glue,' ')"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:element>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates select="itemizedlist/listitem"
|
|
|
|
mode="perlmod-dep">
|
|
|
|
<xsl:sort select="position()"
|
|
|
|
data-type="number"
|
|
|
|
order="descending"/>
|
|
|
|
<xsl:with-param name="glue" select="$glue"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|