r3942 - in jhalfs/branches/new_features: LFS common/libs

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Mon Mar 27 09:26:14 PDT 2017


Author: pierre
Date: Mon Mar 27 09:26:14 2017
New Revision: 3942

Log:
Merge trunk r3940,41

Modified:
   jhalfs/branches/new_features/LFS/lfs.xsl
   jhalfs/branches/new_features/common/libs/func_book_parser

Modified: jhalfs/branches/new_features/LFS/lfs.xsl
==============================================================================
--- jhalfs/branches/new_features/LFS/lfs.xsl	Mon Mar 27 09:14:49 2017	(r3941)
+++ jhalfs/branches/new_features/LFS/lfs.xsl	Mon Mar 27 09:26:14 2017	(r3942)
@@ -10,6 +10,10 @@
 
 <!-- Parameters -->
 
+  <!-- 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
@@ -69,19 +73,24 @@
 <!-- End parameters -->
 
   <xsl:template match="/">
-    <xsl:apply-templates select="//sect1"/>
+    <xsl:apply-templates select="//sect1[not(@revision) or
+                                         @revision=$revision]"/>
   </xsl:template>
   
   <xsl:template match="sect1">
+<!-- Since this xsl:if tag encloses the whole template, it would
+     be much better to transpose this condition to the select part
+     of the "calling" apply-template. But that would change the numbering,
+     so that it would be difficult to compare to previous versions. So for
+     version 2.4, let us keep this -->
         <xsl:if test="(../@id='chapter-temporary-tools' or
                   ../@id='chapter-building-system' or
                   ../@id='chapter-bootscripts' or
                   ../@id='chapter-bootable') and
-                  count(descendant::screen/userinput) > 0 and
-                  count(descendant::screen/userinput) >
-                      count(descendant::screen[@role='nodump']) and
-                  count(descendant::screen/userinput) >
-                      count(descendant::screen/userinput[starts-with(string(),'chroot')])">
+                  (sect2[not(@revision) or @revision=$revision]//..|.)/
+                      screen[(not(@role) or @role != 'nodump') and
+                             (not(@revision) or @revision=$revision)]/
+                          userinput[not(starts-with(string(),'chroot'))]">
 <!-- The last condition is a hack to allow previous versions of the
      book where the chroot commands did not have role="nodump".
      It only works if the chroot command is the only one on the page -->
@@ -148,9 +157,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[
@@ -173,8 +185,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
@@ -213,8 +227,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
@@ -318,8 +334,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/branches/new_features/common/libs/func_book_parser
==============================================================================
--- jhalfs/branches/new_features/common/libs/func_book_parser	Mon Mar 27 09:14:49 2017	(r3941)
+++ jhalfs/branches/new_features/common/libs/func_book_parser	Mon Mar 27 09:26:14 2017	(r3942)
@@ -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      \
@@ -178,9 +173,7 @@
                  --stringparam nameserver2    $DNS2         \
                  --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