[Clfs-commits] [Cross-LFS]Cross-LFS Book branch, simp, updated. 5171adca829902bb102d73778a743a5902363df0

git git at cross-lfs.org
Sat Mar 5 21:01:20 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  5171adca829902bb102d73778a743a5902363df0 (commit)
       via  5508d22676602e7a2e863b67d691fe10ab754dc9 (commit)
       via  4a392527b781300876ac453ed229448f18f73e12 (commit)
       via  d17cfb850856d213a80b7ec8dbf172cf4d66e710 (commit)
      from  4fe47e3bef69ecfb889662874056080c1f67b61f (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 5171adca829902bb102d73778a743a5902363df0
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sun Mar 6 00:00:40 2011 -0500

    Update the package-iterator in the stylesheet. Fixed an issue where
    the default bits on a multilib system was the first in the list instead
    of the last. Also simplified the xsl.

diff --git a/BOOK/stylesheets/clfs-profile.xsl b/BOOK/stylesheets/clfs-profile.xsl
index dc43932..669e72d 100644
--- a/BOOK/stylesheets/clfs-profile.xsl
+++ b/BOOK/stylesheets/clfs-profile.xsl
@@ -36,40 +36,34 @@
     <xsl:param name="id" /> <!-- Base ID of the resulting package -->
     <xsl:param name="multibuild" /> <!-- Do we need to install for each bitsize? -->
     <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
-    <xsl:choose>
-      <xsl:when test="$multibuild = 'true'">
-        <xsl:variable name="currentbits" select="substring-before(concat($bits, ','), ',')" />
-        <xsl:variable name="remainingbits" select="substring-after($bits, ',')" />
-        <xsl:call-template name="package-stub">
-          <xsl:with-param name="id" select="$id" />
-          <xsl:with-param name="idsuffix">
-            <xsl:if test="$remainingbits">
-              <xsl:value-of select="concat('-', $currentbits)" />
-            </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:call-template>
-        <xsl:if test="$remainingbits">
-          <xsl:text>
-
-          </xsl:text>
-          <xsl:call-template name="package-iterator">
-            <xsl:with-param name="id" select="$id" />
-            <xsl:with-param name="multibuild" select="$multibuild" />
-            <xsl:with-param name="bits" select="$remainingbits" />
-          </xsl:call-template>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="package-stub">
-          <xsl:with-param name="id" select="$id" />
-          <xsl:with-param name="idsuffix" />
-          <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
-          <xsl:with-param name="multi"><xsl:text>single</xsl:text></xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
+
+    <xsl:variable name="currentbits" select="substring-before(concat($bits, ','), ',')" />
+    <xsl:variable name="remainingbits" select="substring-after($bits, ',')" />
+
+    <xsl:if test="not(boolean($remainingbits) and $multibuild = 'false')">
+      <xsl:call-template name="package-stub">
+        <xsl:with-param name="id" select="$id" />
+        <xsl:with-param name="idsuffix">
+          <xsl:if test="$remainingbits">
+            <xsl:value-of select="concat('-', $currentbits)" />
+          </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:call-template>
+    </xsl:if>
+
+    <xsl:if test="$remainingbits">
+      <xsl:text>
+
+      </xsl:text>
+      <xsl:call-template name="package-iterator">
+        <xsl:with-param name="id" select="$id" />
+        <xsl:with-param name="multibuild" select="$multibuild" />
+        <xsl:with-param name="bits" select="$remainingbits" />
+      </xsl:call-template>
+    </xsl:if>
+
   </xsl:template>
 
   <xsl:template name="package-stub">

commit 5508d22676602e7a2e863b67d691fe10ab754dc9
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sat Mar 5 23:48:28 2011 -0500

    Automatically add the suffix to the title containing the bitsize on multilib.

diff --git a/BOOK/stylesheets/clfs-profile.xsl b/BOOK/stylesheets/clfs-profile.xsl
index 524393c..dc43932 100644
--- a/BOOK/stylesheets/clfs-profile.xsl
+++ b/BOOK/stylesheets/clfs-profile.xsl
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns="http://www.w3.org/1999/xhtml"
   xmlns:c="http://schema.cross-lfs.org/book"
   version="1.0">
 
@@ -49,6 +48,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:call-template>
         <xsl:if test="$remainingbits">
           <xsl:text>
@@ -66,6 +66,7 @@
           <xsl:with-param name="id" select="$id" />
           <xsl:with-param name="idsuffix" />
           <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
+          <xsl:with-param name="multi"><xsl:text>single</xsl:text></xsl:with-param>
         </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
@@ -75,9 +76,9 @@
     <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:for-each select="sect1">
-
       <xsl:copy>
         <xsl:attribute name="id">
           <xsl:value-of select="concat($id, $idsuffix)" />
@@ -85,6 +86,9 @@
         <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)" />
@@ -107,6 +111,15 @@
 
   <!-- 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>
@@ -134,6 +147,15 @@
   <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">
@@ -162,6 +184,15 @@
   <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">
diff --git a/BOOK/testpart.xml b/BOOK/testpart.xml
index 9a05eb7..f10cef9 100644
--- a/BOOK/testpart.xml
+++ b/BOOK/testpart.xml
@@ -22,22 +22,20 @@
 
       <c:package id="blah" c:multibuild="false">
         <sect1>
-          <title>Blah</title>
+          <title><phrase>Blah</phrase></title>
 
           <para>Testing... 1.. 2.. 3..</para>
 
+          <para c:bits="32">32</para>
+          <para c:bits="n32">n32</para>
+          <para c:bits="64">64</para>
+
         </sect1>
       </c:package>
 
       <c:package id="blarg" c:multibuild="true">
         <sect1>
-          <title>Blarg
-            <phrase c:multilib="true">
-              <phrase c:bits="32"> - 32Bit</phrase>
-              <phrase c:bits="n32"> - N32</phrase>
-              <phrase c:bits="64"> - 64Bit</phrase>
-            </phrase>
-          </title>
+          <title>Blarg</title>
 
           <para>Testing... 1.. 2.. 3..</para>
 

commit 4a392527b781300876ac453ed229448f18f73e12
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sat Mar 5 22:35:51 2011 -0500

    Properly filter the descendents of c:package based on the filtering
    attributes that are set. This marks a point where the stylesheet is stable.

diff --git a/BOOK/stylesheets/clfs-profile.xsl b/BOOK/stylesheets/clfs-profile.xsl
index 6c0b8e4..524393c 100644
--- a/BOOK/stylesheets/clfs-profile.xsl
+++ b/BOOK/stylesheets/clfs-profile.xsl
@@ -14,7 +14,7 @@
 
   <xsl:param name="clfs.arch" select="''" />
   <xsl:param name="clfs.multilib" select="''" />
-  
+
   <!-- Apply the other templates -->
   <xsl:template match="@*|node()" priority="-1">
     <xsl:copy>
@@ -22,6 +22,7 @@
     </xsl:copy>
   </xsl:template>
 
+  <!-- Build the package xml -->
   <xsl:template match="//c:package">
     <xsl:param name="id" select="@id" />
     <xsl:param name="multibuild" select="@c:multibuild" />
@@ -76,22 +77,119 @@
     <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
 
     <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: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:apply-templates select="child::node()[(string-length(@c:bits) = 0) or contains(concat(',', at c:bits,','), concat(',', $bits, ','))]" />
+        <xsl:choose>
+          <xsl:when test="$bits = '32'">
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
+          </xsl:when>
+          <xsl:when test="$bits = 'n32'">
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
+          </xsl:when>
+          <xsl:when test="$bits = '64'">
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
+          </xsl:when>
+        </xsl:choose>
       </xsl:copy>
     </xsl:for-each>
   </xsl:template>
 
-  <!-- Apply the build profile filter -->
+  <!-- Apply the profile to the 32bit package -->
+
+  <xsl:template match="@*|node()" mode="filter-bits-32">
+    <xsl:variable name="ismultilib">
+      <xsl:choose>
+        <xsl:when test="contains($clfs.multilib, ',')">
+          <xsl:text>true</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>false</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',', at c:arch,','), concat(',', $clfs.arch, ','))">
+      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',', at c:multilib,','), concat(',', $ismultilib, ','))">
+        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',', at c:bits,','), ',32,')">
+          <xsl:copy>
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
+          </xsl:copy>
+        </xsl:if>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="@c:arch" mode="filter-bits-32" />
+  <xsl:template match="@c:bits" mode="filter-bits-32" />
+  <xsl:template match="@c:multilib" mode="filter-bits-32" />
+
+  <!-- Apply the profile to the n32 package -->
+
+  <xsl:template match="@*|node()" mode="filter-bits-n32">
+    <xsl:variable name="ismultilib">
+      <xsl:choose>
+        <xsl:when test="contains($clfs.multilib, ',')">
+          <xsl:text>true</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>false</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',', at c:arch,','), concat(',', $clfs.arch, ','))">
+      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',', at c:multilib,','), concat(',', $ismultilib, ','))">
+        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',', at c:bits,','), ',n32,')">
+          <xsl:copy>
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
+          </xsl:copy>
+        </xsl:if>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="@c:arch" mode="filter-bits-n32" />
+  <xsl:template match="@c:bits" mode="filter-bits-n32" />
+  <xsl:template match="@c:multilib" mode="filter-bits-n32" />
+
+  <!-- Apply the profile to the 64bit package -->
+
+  <xsl:template match="@*|node()" mode="filter-bits-64">
+    <xsl:variable name="ismultilib">
+      <xsl:choose>
+        <xsl:when test="contains($clfs.multilib, ',')">
+          <xsl:text>true</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>false</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',', at c:arch,','), concat(',', $clfs.arch, ','))">
+      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',', at c:multilib,','), concat(',', $ismultilib, ','))">
+        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',', at c:bits,','), ',64,')">
+          <xsl:copy>
+            <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
+          </xsl:copy>
+        </xsl:if>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="@c:arch" mode="filter-bits-64" />
+  <xsl:template match="@c:bits" mode="filter-bits-64" />
+  <xsl:template match="@c:multilib" mode="filter-bits-64" />
 
+  <!-- Apply the profile filter to the entire document -->
   <xsl:template match="//*[@c:arch]|//*[@c:multilib]">
     <xsl:variable name="ismultilib">
       <xsl:choose>
@@ -106,14 +204,13 @@
     <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',', at c:arch,','), concat(',', $clfs.arch, ','))">
       <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',', at c:multilib,','), concat(',', $ismultilib, ','))">
         <xsl:copy>
-          <xsl:apply-templates select="@*|node()"/>
+          <xsl:apply-templates select="@*|node()" />
         </xsl:copy>
       </xsl:if>
     </xsl:if>
   </xsl:template>
 
-  <!-- Remove the profiling attributes specific to this stylesheet -->
-
+  <!-- Remove the profileing attributes for the remaining objects -->
   <xsl:template match="@c:arch" />
   <xsl:template match="@c:bits" />
   <xsl:template match="@c:multilib" />

commit d17cfb850856d213a80b7ec8dbf172cf4d66e710
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sat Mar 5 22:32:48 2011 -0500

    Added another test case to the test part.

diff --git a/BOOK/testpart.xml b/BOOK/testpart.xml
index 19bb660..9a05eb7 100644
--- a/BOOK/testpart.xml
+++ b/BOOK/testpart.xml
@@ -41,6 +41,8 @@
 
           <para>Testing... 1.. 2.. 3..</para>
 
+          <para c:multilib="true" c:bits="64">This is for 64bit multilib only</para>
+
           <para c:bits="32,n32">Only 32,N32</para>
 
 <screen c:bits="32"><userinput>echo 32bit Build</userinput></screen>

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

Summary of changes:
 BOOK/stylesheets/clfs-profile.xsl |  200 +++++++++++++++++++++++++++++-------
 BOOK/testpart.xml                 |   16 ++--
 2 files changed, 169 insertions(+), 47 deletions(-)


hooks/post-receive
-- 
Cross-LFS Book



More information about the Clfs-commits mailing list