summaryrefslogtreecommitdiff
path: root/Build/cdbuild/vpm2vlist.xsl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2005-12-27 23:56:17 +0000
committerKarl Berry <karl@freefriends.org>2005-12-27 23:56:17 +0000
commit577983747d8680b8defbfdd03a9d50bad6fd54b7 (patch)
tree16b160f53c6c4c309c07db2c5b095d3abb16f69a /Build/cdbuild/vpm2vlist.xsl
parent07fed0169bae91dfb5616f9d19e7969727e19d4d (diff)
initial Build
git-svn-id: svn://tug.org/texlive/trunk@4 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/cdbuild/vpm2vlist.xsl')
-rw-r--r--Build/cdbuild/vpm2vlist.xsl91
1 files changed, 91 insertions, 0 deletions
diff --git a/Build/cdbuild/vpm2vlist.xsl b/Build/cdbuild/vpm2vlist.xsl
new file mode 100644
index 00000000000..347002576a0
--- /dev/null
+++ b/Build/cdbuild/vpm2vlist.xsl
@@ -0,0 +1,91 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:exsl="http://exslt.org/common"
+ exclude-result-prefixes="exsl"
+ extension-element-prefixes="exsl"
+ xmlns:TPM="http://texlive.dante.de/"
+ version="1.0">
+
+<xsl:output method="xml" omit-xml-declaration="yes"/>
+
+<xsl:strip-space elements="*"/>
+
+<xsl:variable name="Master">/texlive/Master/texmf-dist/tpm/lists/</xsl:variable>
+<xsl:variable name="TPM">/texlive/Master/texmf-dist/tpm</xsl:variable>
+<xsl:variable name="BINARY">/texlive/Master/texmf-dist/tpm/binary/</xsl:variable>
+<xsl:variable name="PACKAGE">/texlive/Master/texmf-dist/tpm/package/</xsl:variable>
+<xsl:variable name="COL">texmf-dist/tpm/collection/</xsl:variable>
+<xsl:variable name="LISTS">texmf-dist/tpm/lists/</xsl:variable>
+
+<xsl:template match="/">
+ <xsl:message>Write <xsl:value-of select="concat($Master,.//TPM:Name)"/>.vlist</xsl:message>
+ <exsl:document href="{concat($Master,//TPM:Name)}.vlist" method="text">
+<xsl:text>*Title: </xsl:text>
+ <xsl:value-of select="normalize-space(.//TPM:Title)"/>
+<xsl:text>&#10;</xsl:text>
+<xsl:variable name="foo">
+ <xsl:apply-templates select=".//TPM:Requires" mode="size"/>
+</xsl:variable>
+<xsl:text>*Size: </xsl:text>
+<xsl:variable name="S">
+ <xsl:value-of select="sum(exsl:node-set($foo)/S/size)"/>
+</xsl:variable>
+<xsl:choose>
+ <xsl:when test="$S='NaN'">1</xsl:when>
+ <xsl:when test="contains($S,'.')">
+ <xsl:value-of select="substring-before($S,'.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$S"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+ <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:text>&#10;</xsl:text>
+ <xsl:value-of select="$COL"/>
+ <xsl:value-of select=".//TPM:Name"/><xsl:text>.tpm&#10;</xsl:text>
+ <xsl:text>&#10;</xsl:text>
+ <xsl:value-of select="$LISTS"/>
+ <xsl:value-of select=".//TPM:Name"/>
+ <xsl:text>.vlist&#10;</xsl:text>
+ </exsl:document>
+</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:Requires">
+<xsl:for-each select="TPM:Package|TPM:Binary">
+<xsl:text>+</xsl:text>
+<xsl:value-of select="translate(normalize-space(@name),' ','&#10;')"/>
+<xsl:text>&#10;</xsl:text>
+</xsl:for-each>
+<xsl:for-each select="TPM:Collection">
+<xsl:text>-</xsl:text>
+<xsl:value-of select="translate(normalize-space(@name),' ','&#10;')"/>
+<xsl:text>&#10;</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="TPM:Requires" mode="size">
+<S>
+<xsl:for-each select="TPM:Binary">
+ <size><xsl:value-of select="document(concat($BINARY,concat(@name,'.tpm')))//TPM:DocFiles/@size div 1000"/></size>
+ <size><xsl:value-of select="document(concat($BINARY,concat(@name,'.tpm')))//TPM:RunFiles/@size div 1000"/></size>
+ <size><xsl:value-of select="document(concat($BINARY,concat(@name,'.tpm')))//TPM:SourceFiles/@size div 1000"/></size>
+</xsl:for-each>
+<xsl:for-each select="TPM:Package">
+ <size><xsl:value-of select="document(concat($PACKAGE,concat(@name,'.tpm')))//TPM:DocFiles/@size div 1000"/></size>
+ <size><xsl:value-of select="document(concat($PACKAGE,concat(@name,'.tpm')))//TPM:RunFiles/@size div 1000"/></size>
+ <size><xsl:value-of select="document(concat($PACKAGE,concat(@name,'.tpm')))//TPM:SourceFiles/@size div 1000"/></size>
+</xsl:for-each>
+</S>
+</xsl:template>
+
+
+
+</xsl:stylesheet>