r3504 - in jhalfs/branches/experimental: XSL common common/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Sep 29 06:55:11 PDT 2007


Author: manuel
Date: 2007-09-29 07:55:10 -0600 (Sat, 29 Sep 2007)
New Revision: 3504

Added:
   jhalfs/branches/experimental/XSL/urls.xsl
Removed:
   jhalfs/branches/experimental/common/urls.xsl
Modified:
   jhalfs/branches/experimental/common/libs/func_download_pkgs
Log:
Moved urls.xsl to XSL dir.

Copied: jhalfs/branches/experimental/XSL/urls.xsl (from rev 3476, jhalfs/branches/experimental/common/urls.xsl)
===================================================================
--- jhalfs/branches/experimental/XSL/urls.xsl	                        (rev 0)
+++ jhalfs/branches/experimental/XSL/urls.xsl	2007-09-29 13:55:10 UTC (rev 3504)
@@ -0,0 +1,130 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!-- $Id$ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:output method="text"/>
+
+  <!-- The FTP server used as fallback -->
+  <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
+
+  <!-- The book family (lfs or clfs). Needed to use the proper FTP path. -->
+  <xsl:param name="family">lfs</xsl:param>
+
+  <!-- The libc model used for HLFS -->
+  <xsl:param name="model" select="glibc"/>
+
+  <!-- The kernel series used for HLFS -->
+  <xsl:param name="kernel" select="2.6"/>
+
+  <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 due that may be splitted for PDF output -->
+    <xsl:if test="(ancestor::varlistentry[@condition=$model]
+                  or not(ancestor::varlistentry[@condition])) and
+                  (ancestor::varlistentry[@vendor=$kernel]
+                  or not(ancestor::varlistentry[@vendor])) and
+                  (contains(@url, '.bz2') or contains(@url, '.tar.gz') or
+                  contains(@url, '.tgz') or contains(@url, '.patch')) and
+                  not(ancestor-or-self::*/@condition = 'pdf')">
+      <!-- Extract the package name -->
+      <xsl:variable name="package">
+        <xsl:call-template name="package.name">
+          <xsl:with-param name="url" select="@url"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <!-- Extract the directory for that package -->
+      <xsl:variable name="cut"
+                    select="translate(substring-after($package, '-'),
+                    '0123456789', '0000000000')"/>
+      <xsl:variable name="package2">
+        <xsl:value-of select="substring-before($package, '-')"/>
+        <xsl:text>-</xsl:text>
+        <xsl:value-of select="$cut"/>
+      </xsl:variable>
+      <xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
+      <!-- Write the upstream URLs, fixing the redirected ones -->
+      <xsl:choose>
+        <xsl:when test="contains(@url,'?')">
+          <xsl:value-of select="substring-before(@url,'?')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@url"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:text> </xsl:text>
+      <!-- Write FTP mirror URLs -->
+      <xsl:value-of select="$server"/>
+      <xsl:text>/pub/</xsl:text>
+      <xsl:value-of select="$family"/>
+      <xsl:text>/conglomeration/</xsl:text>
+      <xsl:choose>
+        <!-- Fix some directories. Test against $dirname to be sure that we
+        are matching the start of a package name, not a string in a patch name
+        But some packages requires test against $package. -->
+        <xsl:when test="contains($dirname, 'bash')">
+          <xsl:text>bash/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($package, 'dvhtool')">
+          <xsl:text>dvhtool/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($dirname, 'gcc')">
+          <xsl:text>gcc/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($dirname, 'glibc')">
+          <xsl:text>glibc/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($package, 'powerpc-utils')">
+          <xsl:text>powerpc-utils/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($package, 'tcl')">
+          <xsl:text>tcl/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($package, 'uClibc')">
+          <xsl:text>uClibc/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($dirname, 'udev')">
+          <xsl:text>udev/</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$dirname"/>
+          <xsl:text>/</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:value-of select="$package"/>
+      <!-- Write MD5SUM value -->
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="../..//para/literal"/>
+      <xsl:text>&#x0a;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="package.name">
+    <xsl:param name="url"/>
+    <xsl:choose>
+      <xsl:when test="contains($url, '/')">
+        <xsl:call-template name="package.name">
+          <xsl:with-param name="url" select="substring-after($url, '/')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="contains($url, '?')">
+            <xsl:value-of select="substring-before($url, '?')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$url"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

Modified: jhalfs/branches/experimental/common/libs/func_download_pkgs
===================================================================
--- jhalfs/branches/experimental/common/libs/func_download_pkgs	2007-09-29 13:51:34 UTC (rev 3503)
+++ jhalfs/branches/experimental/common/libs/func_download_pkgs	2007-09-29 13:55:10 UTC (rev 3504)
@@ -137,7 +137,7 @@
         xsltproc --nonet --xinclude \
                  --stringparam server $SERVER \
                  --stringparam family clfs \
-                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/$COMMON_DIR/urls.xsl \
+                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;
@@ -146,7 +146,7 @@
         xsltproc --nonet --xinclude \
                  --stringparam server $SERVER \
                  --stringparam family clfs \
-                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/$COMMON_DIR/urls.xsl \
+                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;
@@ -155,7 +155,7 @@
         xsltproc --nonet --xinclude \
                  --stringparam server $SERVER \
                  --stringparam family clfs \
-                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/$COMMON_DIR/urls.xsl \
+                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;
@@ -166,7 +166,7 @@
                  --stringparam family lfs \
                  --stringparam model $MODEL \
                  --stringparam kernel $KERNEL \
-                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/$COMMON_DIR/urls.xsl \
+                 -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;
@@ -175,7 +175,7 @@
         xsltproc --nonet --xinclude \
                  --stringparam server $SERVER \
                  --stringparam family lfs \
-                 -o ../sources/urls.lst $CODE_DIR/$COMMON_DIR/urls.xsl \
+                 -o ../sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;

Deleted: jhalfs/branches/experimental/common/urls.xsl
===================================================================
--- jhalfs/branches/experimental/common/urls.xsl	2007-09-29 13:51:34 UTC (rev 3503)
+++ jhalfs/branches/experimental/common/urls.xsl	2007-09-29 13:55:10 UTC (rev 3504)
@@ -1,130 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-
-<!-- $Id$ -->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="1.0">
-
-  <xsl:output method="text"/>
-
-  <!-- The FTP server used as fallback -->
-  <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
-
-  <!-- The book family (lfs or clfs). Needed to use the proper FTP path. -->
-  <xsl:param name="family">lfs</xsl:param>
-
-  <!-- The libc model used for HLFS -->
-  <xsl:param name="model" select="glibc"/>
-
-  <!-- The kernel series used for HLFS -->
-  <xsl:param name="kernel" select="2.6"/>
-
-  <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 due that may be splitted for PDF output -->
-    <xsl:if test="(ancestor::varlistentry[@condition=$model]
-                  or not(ancestor::varlistentry[@condition])) and
-                  (ancestor::varlistentry[@vendor=$kernel]
-                  or not(ancestor::varlistentry[@vendor])) and
-                  (contains(@url, '.bz2') or contains(@url, '.tar.gz') or
-                  contains(@url, '.tgz') or contains(@url, '.patch')) and
-                  not(ancestor-or-self::*/@condition = 'pdf')">
-      <!-- Extract the package name -->
-      <xsl:variable name="package">
-        <xsl:call-template name="package.name">
-          <xsl:with-param name="url" select="@url"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <!-- Extract the directory for that package -->
-      <xsl:variable name="cut"
-                    select="translate(substring-after($package, '-'),
-                    '0123456789', '0000000000')"/>
-      <xsl:variable name="package2">
-        <xsl:value-of select="substring-before($package, '-')"/>
-        <xsl:text>-</xsl:text>
-        <xsl:value-of select="$cut"/>
-      </xsl:variable>
-      <xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
-      <!-- Write the upstream URLs, fixing the redirected ones -->
-      <xsl:choose>
-        <xsl:when test="contains(@url,'?')">
-          <xsl:value-of select="substring-before(@url,'?')"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@url"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text> </xsl:text>
-      <!-- Write FTP mirror URLs -->
-      <xsl:value-of select="$server"/>
-      <xsl:text>/pub/</xsl:text>
-      <xsl:value-of select="$family"/>
-      <xsl:text>/conglomeration/</xsl:text>
-      <xsl:choose>
-        <!-- Fix some directories. Test against $dirname to be sure that we
-        are matching the start of a package name, not a string in a patch name
-        But some packages requires test against $package. -->
-        <xsl:when test="contains($dirname, 'bash')">
-          <xsl:text>bash/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($package, 'dvhtool')">
-          <xsl:text>dvhtool/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($dirname, 'gcc')">
-          <xsl:text>gcc/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($dirname, 'glibc')">
-          <xsl:text>glibc/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($package, 'powerpc-utils')">
-          <xsl:text>powerpc-utils/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($package, 'tcl')">
-          <xsl:text>tcl/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($package, 'uClibc')">
-          <xsl:text>uClibc/</xsl:text>
-        </xsl:when>
-        <xsl:when test="contains($dirname, 'udev')">
-          <xsl:text>udev/</xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$dirname"/>
-          <xsl:text>/</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:value-of select="$package"/>
-      <!-- Write MD5SUM value -->
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="../..//para/literal"/>
-      <xsl:text>&#x0a;</xsl:text>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template name="package.name">
-    <xsl:param name="url"/>
-    <xsl:choose>
-      <xsl:when test="contains($url, '/')">
-        <xsl:call-template name="package.name">
-          <xsl:with-param name="url" select="substring-after($url, '/')"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when test="contains($url, '?')">
-            <xsl:value-of select="substring-before($url, '?')"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$url"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-</xsl:stylesheet>




More information about the alfs-log mailing list