aboutsummaryrefslogtreecommitdiffstats
path: root/stylesheets
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2011-10-08 02:12:06 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2011-10-08 02:12:06 +0000
commitdaed5a3e75d60b08ebf67e8d4287c152908aa764 (patch)
tree76acad3ecc447ba6560c8475b37b745f7ea9d8b7 /stylesheets
parent3fffa40201f72e3038066af1f45ca8f97b88b2e7 (diff)
Miror update to bootscripts Makefile.
Add capability in main Makefile to create md5sum file. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9618 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'stylesheets')
-rw-r--r--stylesheets/md5sum.xsl58
1 files changed, 58 insertions, 0 deletions
diff --git a/stylesheets/md5sum.xsl b/stylesheets/md5sum.xsl
new file mode 100644
index 000000000..d179594af
--- /dev/null
+++ b/stylesheets/md5sum.xsl
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!-- Create a md5 list for packages and pathces used. -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:output method="text"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="//ulink"/>
+ </xsl:template>
+
+ <xsl:template match="ulink">
+ <!-- If some package don't have the predefined strings in their
+ name, the next test must be fixed to match it also. Skip possible
+ duplicated URLs that may be split for PDF output -->
+ <xsl:if test="(contains( @url, '.tar.' ) or
+ contains( @url, '.tgz' ) or
+ contains( @url, '.patch') ) and
+ not( ancestor-or-self::*/@condition = 'pdf' )" >
+ <!-- Get the md5sum -->
+ <xsl:value-of select="../../para/literal"/>
+
+ <!-- Add two spaces -->
+ <xsl:text> </xsl:text>
+
+ <!-- Get the basename -->
+ <xsl:call-template name="basename">
+ <xsl:with-param name="pathname" select="@url"/>
+ </xsl:call-template>
+
+ <!-- Add a newline -->
+ <xsl:text>&#x0a;</xsl:text>
+
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="basename">
+ <xsl:param name="pathname"/>
+
+ <xsl:choose>
+
+ <xsl:when test="contains( $pathname, '/' )" >
+ <xsl:call-template name="basename">
+ <xsl:with-param name="pathname" select="substring-after( $pathname, '/' )" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:value-of select="$pathname"/>
+ </xsl:otherwise>
+
+ </xsl:choose>
+ </xsl:template>
+
+</xsl:stylesheet>
+