r3940 - in jhalfs/trunk: LFS common/libs

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Mon Mar 27 02:40:41 PDT 2017


Author: pierre
Date: Mon Mar 27 02:40:41 2017
New Revision: 3940

Log:
When choosing the LFS book, we should not depend on docbook-xml. This is achieved by directly treating the revision attribute in lfs.xsl, instead of using profiling from docbook-xsl.

Modified:
   jhalfs/trunk/LFS/lfs.xsl
   jhalfs/trunk/common/libs/func_book_parser

Modified: jhalfs/trunk/LFS/lfs.xsl
==============================================================================
--- jhalfs/trunk/LFS/lfs.xsl	Sat Mar 25 14:02:19 2017	(r3939)
+++ jhalfs/trunk/LFS/lfs.xsl	Mon Mar 27 02:40:41 2017	(r3940)
@@ -8,6 +8,10 @@
       extension-element-prefixes="exsl"
       version="1.0">
 
+  <!-- which revision attribute to include: can only be sysv or systemd,
+       but we leave checking to the caller-->
+  <xsl:param name="revision" select="'sysv'"/>
+
   <!-- use package management ?
        n = no, original behavior
        y = yes, add PKG_DEST to scripts in install commands of chapter06-08
@@ -44,7 +48,8 @@
   <xsl:param name='full-locale' select='n'/>
   
   <xsl:template match="/">
-    <xsl:apply-templates select="//sect1"/>
+    <xsl:apply-templates select="//sect1[not(@revision) or
+                                         @revision=$revision]"/>
   </xsl:template>
   
   <xsl:template match="sect1">
@@ -123,9 +128,12 @@
       <xsl:if test="sect2[@role='installation']">
         <xsl:text>cd $PKGDIR&#xA;</xsl:text>
       </xsl:if>
-      <xsl:apply-templates select="sect2|
-                                   screen[not(@role) or
-                                          @role!='nodump']/userinput"/>
+      <xsl:apply-templates select="sect2[not(@revision) or
+                                         @revision=$revision] |
+                                   screen[(not(@role) or
+                                           @role!='nodump') and
+                                          (not(@revision) or
+                                           @revision=$revision)]/userinput"/>
       <xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
         <xsl:apply-templates
            select="document('packageManager.xml')//sect1[
@@ -148,8 +156,10 @@
 
   <xsl:template match="sect2">
     <xsl:apply-templates
-      select=".//screen[not(@role) or
-                        @role != 'nodump']/userinput[
+      select=".//screen[(not(@role) or
+                         @role != 'nodump') and
+                        (not(@revision) or
+                         @revision=$revision)]/userinput[
                              @remap = 'pre' or
                              @remap = 'configure' or
                              @remap = 'make' or
@@ -179,8 +189,10 @@
 </xsl:text>
     </xsl:if>
     <xsl:apply-templates
-         select=".//screen[not(@role) or
-                           @role != 'nodump']/userinput[@remap = 'install']"/>
+         select=".//screen[(not(@role) or
+                            @role != 'nodump') and
+                           (not(@revision) or
+                            @revision=$revision)]/userinput[@remap = 'install']"/>
     <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
                   $pkgmngt = 'y' and
                   descendant::screen[not(@role) or
@@ -255,8 +267,10 @@
     </xsl:if>
     <xsl:apply-templates
        select=".//screen[
-                 not(@role) or
-                 @role != 'nodump'
+                (not(@role) or
+                 @role != 'nodump') and
+                (not(@revision) or
+                 @revision=$revision)
                         ]/userinput[
                        not(@remap) or
                        @remap='adjust' or

Modified: jhalfs/trunk/common/libs/func_book_parser
==============================================================================
--- jhalfs/trunk/common/libs/func_book_parser	Sat Mar 25 14:02:19 2017	(r3939)
+++ jhalfs/trunk/common/libs/func_book_parser	Mon Mar 27 02:40:41 2017	(r3940)
@@ -150,14 +150,9 @@
         fi
         popd > /dev/null
 
-        xsltproc --nonet                                 \
-                 --xinclude                              \
-                 --output /tmp/lfs-full.xml              \
-                 --stringparam profile.revision $INITSYS \
-                 $BOOK/stylesheets/lfs-xsl/profile.xsl   \
-                 $BOOK/index.xml
-
         xsltproc --nonet                                   \
+                 --xinclude                                \
+                 --stringparam revision       $INITSYS     \
                  --stringparam testsuite      $TEST        \
                  --stringparam bomb-testsuite $BOMB_TEST   \
                  --stringparam vim-lang       $VIMLANG     \
@@ -168,9 +163,7 @@
                  --stringparam pkgmngt        $PKGMNGT     \
                  --output ./${PROGNAME}-commands/          \
                  $XSL                                      \
-                 /tmp/lfs-full.xml >>$LOGDIR/$LOG 2>&1
-
-        rm /tmp/lfs-full.xml
+                 $BOOK/index.xml
       ;;
     *)  echo -n " ${L_arrow}${PROGNAME}${R_arrow} book invalid, terminate build... "
         exit 1 ;;


More information about the alfs-log mailing list