summaryrefslogtreecommitdiff
path: root/Build/tools/tpm2list.xsl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-02-13 00:49:47 +0000
committerKarl Berry <karl@freefriends.org>2006-02-13 00:49:47 +0000
commit045f872c421bb96d9e680ccd7f79c823cef10521 (patch)
tree20483574ec8846ce1adb25e905f4a0b4e2505a41 /Build/tools/tpm2list.xsl
parenta1e47d103e66e2a947105dd7378e8df3918c3f62 (diff)
move Master/Tools to Build/tools
git-svn-id: svn://tug.org/texlive/trunk@1514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/tools/tpm2list.xsl')
-rw-r--r--Build/tools/tpm2list.xsl98
1 files changed, 98 insertions, 0 deletions
diff --git a/Build/tools/tpm2list.xsl b/Build/tools/tpm2list.xsl
new file mode 100644
index 00000000000..db7919e96e1
--- /dev/null
+++ b/Build/tools/tpm2list.xsl
@@ -0,0 +1,98 @@
+<!-- $Id$
+ Written by Sebastian Rahtz. Public domain. -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ exclude-result-prefixes="exsl"
+ extension-element-prefixes="exsl"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:TPM="http://texlive.dante.de/"
+ version="1.0">
+
+<xsl:output method="xml" omit-xml-declaration="yes"/>
+
+<xsl:strip-space elements="*"/>
+
+<!-- assume the current directory is Master, as Tools/update arranges. -->
+<xsl:param name="ROOT">.</xsl:param>
+
+<xsl:variable name="Master">
+ <xsl:value-of select="$ROOT"/>/texmf/lists/</xsl:variable>
+<xsl:variable name="LISTS">texmf/lists/</xsl:variable>
+
+<xsl:template match="/">
+ <xsl:apply-templates select="rdf:RDF/rdf:Description"/>
+</xsl:template>
+
+<xsl:template match="rdf:Description">
+ <xsl:variable name="File">
+ <xsl:value-of select="TPM:Name"/>
+ </xsl:variable>
+ <xsl:apply-templates select="TPM:BinFiles"/>
+ <exsl:document omit-xml-declaration="yes" method="text" href="{concat($Master,$File)}">
+ <xsl:apply-templates select="TPM:Requires"/>
+ <xsl:apply-templates select="TPM:DocFiles"/><xsl:text>&#10;</xsl:text>
+ <xsl:apply-templates select="TPM:SourceFiles"/><xsl:text>&#10;</xsl:text>
+ <xsl:apply-templates select="TPM:RunFiles"/><xsl:text>&#10;</xsl:text>
+ <xsl:apply-templates select="TPM:Installation"/>
+<xsl:text>&#10;texmf</xsl:text>
+ <xsl:value-of select="substring-after($Master,'texmf')"/>
+ <xsl:value-of select="TPM:Name"/><xsl:text>&#10;</xsl:text></exsl:document>
+<!--
+ <xsl:message>Write <xsl:value-of
+ select="concat($Master,//TPM:Name)"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="@arch"/></xsl:message>
+-->
+</xsl:template>
+
+<xsl:template match="TPM:BinFiles">
+ <exsl:document method="text" href="{$Master}{//TPM:Name}.{@arch}">
+ <xsl:value-of select="translate(normalize-space(.),' ','&#10;')"/>
+<xsl:text>&#10;</xsl:text>
+<xsl:value-of
+ select="concat($LISTS,//TPM:Name)"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="@arch"/>
+<xsl:text>&#10;</xsl:text>
+</exsl:document>
+</xsl:template>
+
+<xsl:template match="TPM:Name" mode="name">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="TPM:DocFiles|TPM:SourceFiles|TPM:RunFiles">
+ <xsl:value-of select="translate(normalize-space(.),' ','&#10;')"/>
+</xsl:template>
+
+<xsl:template match="TPM:Installation">
+ <xsl:for-each select="TPM:Execute">
+ <xsl:variable name="Function">
+ <xsl:choose>
+ <xsl:when test="@mode='mixed' and @function='addMap'">
+ <xsl:text>addMixedMap</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@function"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:text>!</xsl:text>
+ <xsl:value-of select="$Function"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@parameter"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="TPM:Requires">
+<xsl:for-each select="TPM:Package|TPM:TLCore">
+<xsl:sort select="normalize-space(@name)"/>
+<xsl:text>+</xsl:text>
+<xsl:value-of select="translate(normalize-space(@name),' ','&#10;')"/>
+<xsl:text>&#10;</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>