[Clfs-commits] [Cross-LFS]Cross-LFS Book branch, simp, updated. 33cb2bd96a75c78ccae9fc620e3988c08c41aa8b

git git at cross-lfs.org
Sat Mar 5 21:27:25 PST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cross-LFS Book".

The branch, simp has been updated
       via  33cb2bd96a75c78ccae9fc620e3988c08c41aa8b (commit)
      from  5171adca829902bb102d73778a743a5902363df0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 33cb2bd96a75c78ccae9fc620e3988c08c41aa8b
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sun Mar 6 00:27:15 2011 -0500

    Simplify the code to append the bits to the title as well as only
    apply it to packages when there are multiple instances.

diff --git a/BOOK/stylesheets/clfs-profile.xsl b/BOOK/stylesheets/clfs-profile.xsl
index 669e72d..014dada 100644
--- a/BOOK/stylesheets/clfs-profile.xsl
+++ b/BOOK/stylesheets/clfs-profile.xsl
@@ -49,7 +49,7 @@
           </xsl:if>
         </xsl:with-param>
         <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
-        <xsl:with-param name="multi"><xsl:text>multi</xsl:text></xsl:with-param>
+        <xsl:with-param name="multibuild" select="$multibuild" />
       </xsl:call-template>
     </xsl:if>
 
@@ -70,50 +70,62 @@
     <xsl:param name="id" /> <!-- Base ID of the resulting package -->
     <xsl:param name="idsuffix" /> <!-- Suffix to attach to the end of the ID for this perticular instance -->
     <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
-    <xsl:param name="multi" /> <!-- multi/single build -->
+    <xsl:param name="multibuild" /> <!-- Are there multiple instances of this package? -->
 
     <xsl:for-each select="sect1">
+
       <xsl:copy>
+
         <xsl:attribute name="id">
           <xsl:value-of select="concat($id, $idsuffix)" />
         </xsl:attribute>
-        <xsl:attribute name="role">
-          <xsl:text>package</xsl:text>
-        </xsl:attribute>
-        <xsl:attribute name="condition">
-          <xsl:value-of select="$multi" />
-        </xsl:attribute>
+
         <xsl:processing-instruction name="dbhtml">
           <xsl:text>filename="</xsl:text>
           <xsl:value-of select="concat($id, $idsuffix)" />
           <xsl:text>.html"</xsl:text>
         </xsl:processing-instruction>
+
+        <xsl:for-each select="title">
+          <xsl:element name="title">
+            <xsl:copy-of select="@*|node()" />
+            <xsl:if test="contains($clfs.multilib, ',') and ($multibuild = 'true')">
+              <xsl:text> - </xsl:text>
+              <xsl:choose>
+                <xsl:when test="$bits = '32'">
+                  <xsl:text>32Bit</xsl:text>
+                </xsl:when>
+                <xsl:when test="$bits = 'n32'">
+                  <xsl:text>N32</xsl:text>
+                </xsl:when>
+                <xsl:when test="$bits = '64'">
+                  <xsl:text>64Bit</xsl:text>
+                </xsl:when>
+              </xsl:choose>
+            </xsl:if>
+          </xsl:element>
+        </xsl:for-each>
+
         <xsl:choose>
           <xsl:when test="$bits = '32'">
-            <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
+            <xsl:apply-templates select="@*|node()[not(self::title)]" mode="filter-bits-32" />
           </xsl:when>
           <xsl:when test="$bits = 'n32'">
-            <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
+            <xsl:apply-templates select="@*|node()[not(self::title)]" mode="filter-bits-n32" />
           </xsl:when>
           <xsl:when test="$bits = '64'">
-            <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
+            <xsl:apply-templates select="@*|node()[not(self::title)]" mode="filter-bits-64" />
           </xsl:when>
         </xsl:choose>
+
       </xsl:copy>
+
     </xsl:for-each>
+
   </xsl:template>
 
   <!-- Apply the profile to the 32bit package -->
 
-  <xsl:template match="//sect1/title" mode="filter-bits-32">
-    <xsl:element name="title">
-      <xsl:copy-of select="@*|node()" />
-      <xsl:if test="contains($clfs.multilib, ',')">
-        <xsl:text> - 32Bit</xsl:text>
-      </xsl:if>
-    </xsl:element>
-  </xsl:template>
-
   <xsl:template match="@*|node()" mode="filter-bits-32">
     <xsl:variable name="ismultilib">
       <xsl:choose>
@@ -141,15 +153,6 @@
   <xsl:template match="@c:multilib" mode="filter-bits-32" />
 
   <!-- Apply the profile to the n32 package -->
-  
-  <xsl:template match="//sect1/title" mode="filter-bits-n32">
-    <xsl:element name="title">
-      <xsl:copy-of select="@*|node()" />
-      <xsl:if test="contains($clfs.multilib, ',')">
-        <xsl:text> - N32</xsl:text>
-      </xsl:if>
-    </xsl:element>
-  </xsl:template>
 
   <xsl:template match="@*|node()" mode="filter-bits-n32">
     <xsl:variable name="ismultilib">
@@ -178,15 +181,6 @@
   <xsl:template match="@c:multilib" mode="filter-bits-n32" />
 
   <!-- Apply the profile to the 64bit package -->
-  
-  <xsl:template match="//sect1/title" mode="filter-bits-64">
-    <xsl:element name="title">
-      <xsl:copy-of select="@*|node()" />
-      <xsl:if test="contains($clfs.multilib, ',')">
-        <xsl:text> - 64Bit</xsl:text>
-      </xsl:if>
-    </xsl:element>
-  </xsl:template>
 
   <xsl:template match="@*|node()" mode="filter-bits-64">
     <xsl:variable name="ismultilib">

-----------------------------------------------------------------------

Summary of changes:
 BOOK/stylesheets/clfs-profile.xsl |   70 +++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 38 deletions(-)


hooks/post-receive
-- 
Cross-LFS Book



More information about the Clfs-commits mailing list