r6393 - in trunk/BOOK: . stylesheets

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Jan 14 10:57:13 PST 2007


Author: manuel
Date: 2007-01-14 11:57:13 -0700 (Sun, 14 Jan 2007)
New Revision: 6393

Added:
   trunk/BOOK/stylesheets/wget-list.xsl
Modified:
   trunk/BOOK/Makefile
Log:
Added wget-list.xsl

Modified: trunk/BOOK/Makefile
===================================================================
--- trunk/BOOK/Makefile	2007-01-14 18:38:06 UTC (rev 6392)
+++ trunk/BOOK/Makefile	2007-01-14 18:57:13 UTC (rev 6393)
@@ -44,6 +44,10 @@
 	  sed -i -e "s at text/html at application/xhtml+xml at g" $$filename; \
 	done;
 
+wget-list:
+	mkdir -p $(BASEDIR)
+	xsltproc --xinclude --nonet stylesheets/wget-list.xsl index.xml > $(BASEDIR)/wget-list
+
 nochunks:
 	@echo "Generating nochunks version of BLFS..."
 	xsltproc --xinclude --nonet -stringparam profile.condition html \
@@ -59,7 +63,7 @@
 
 pdf:
 	xsltproc --xinclude --nonet --stringparam profile.condition pdf \
-             --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml 
+             --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
 	xsltproc --xinclude --nonet --output blfs.fo \
 	         stylesheets/blfs-pdf.xsl blfs-pdf.xml
 	sed -i -e "s/inherit/all/" blfs.fo
@@ -94,7 +98,7 @@
 
 validate-pdf:
 	xsltproc --xinclude --nonet --stringparam profile.condition pdf \
-             --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml 
+             --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
 	xmllint --noout --nonet --postvalid blfs-pdf.xml
 
 blfs-patch-list:

Added: trunk/BOOK/stylesheets/wget-list.xsl
===================================================================
--- trunk/BOOK/stylesheets/wget-list.xsl	                        (rev 0)
+++ trunk/BOOK/stylesheets/wget-list.xsl	2007-01-14 18:57:13 UTC (rev 6393)
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!-- Create a list of upstream URLs for packages and patches to be used
+     with wget. -->
+
+<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="//itemizedlist"/>
+  </xsl:template>
+
+  <xsl:template match="itemizedlist">
+    <xsl:choose>
+      <!-- If both http and ftp URLs are available, output the ftp one if not empty,
+           otherwise output the http URL.-->
+      <xsl:when test="contains(listitem[1]/para,'(HTTP)')
+                      and contains(listitem[2]/para,'(FTP)')">
+        <xsl:choose>
+          <xsl:when test="string-length(listitem[2]/para/ulink/@url) > '10'">
+            <xsl:apply-templates select="listitem[2]/para/ulink"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="listitem[1]/para/ulink"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <!-- Additional packages and patches.-->
+      <xsl:otherwise>
+        <xsl:apply-templates select="listitem/para/ulink"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="listitem/para/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 due that may be splitted for PDF output -->
+    <xsl:if test="(contains(@url, '.tar.') or contains(@url, '.tgz')
+                  or contains(@url, '.zip') or contains(@url, '.patch')) and
+                  not(ancestor-or-self::*/@condition = 'pdf')">
+      <xsl:choose>
+        <!-- Fix SourceForge links-->
+        <xsl:when test="contains(@url,'?download')">
+          <xsl:value-of select="substring-before(@url,'?download')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@url"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:text>&#x0a;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>
+


Property changes on: trunk/BOOK/stylesheets/wget-list.xsl
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id




More information about the blfs-book mailing list