Nimbin[12]?Mirrors & Forks / jhalfs / commits / bacbb07

jhalfs git · trunk

jhalfs LFS build automation (mirror)

lfs mirror bash · first commit 2005-09-11 · last commit 2024-02-13 (2 years ago) · synced 3 days ago · upstream: git.linuxfromscratch.org/jhalfs

Python 78.4% Shell 19.8% Makefile 1.8%
git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gz

Comments for the inst-instr template

Pierre Labastie · 2023-10-21 19:50 · bacbb075bef607cbcbe4a3cd41d41afcb1018503

kf5 has one push and to popd in its instructions.
We used to just use what was between push and popd.
But now, we need to only use what is in the
case instruction for one package, and what is
after the esac for all the others.
 BLFS/xsl/make_book.xsl | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl
index 42b268a..cacdc12 100644
--- a/BLFS/xsl/make_book.xsl
+++ b/BLFS/xsl/make_book.xsl
@@ -704,24 +704,36 @@ name=$(echo $packagedir | sed 's/-[[:digit:]].*//')
   </xsl:template>
 
   <xsl:template name="inst-instr">
+    <!-- This template is necessary because of the "kapidox" case in kf5:
+         Normally, the general instructions extract the package and change
+         to the extracted dir for running the installation instructions.
+         When installing a sub-package of a compound package, the installation
+         instructions to be run are located between a pushd and a popd,
+         *except* for kf5, where a popd occurs inside a case for kapidox...
+         So we call this template with a "inst-instr" string that contains
+         everything after the pushd.-->
     <xsl:param name="inst-instr"/>
     <xsl:param name="package"/>
     <xsl:choose>
+      <!-- first the case of kf5: there are two "popd"-->
       <xsl:when test="contains(substring-after($inst-instr,'popd'),'popd')">
         <xsl:choose>
           <xsl:when test="$package='kapidox'">
+            <!-- only the instructions inside the "case" and before popd -->
             <xsl:copy-of select="substring-after(substring-before($inst-instr,'popd'),'kapidox)')"/>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:copy-of select="substring-before($inst-instr,'kapidox)')"/>
+            <!-- all what is after the esac -->
             <xsl:call-template name="inst-instr">
-              <xsl:with-param name="inst-instr"
-                              select="substring-after($inst-instr,';;')"/>
+              <xsl:with-param
+                name="inst-instr"
+                select="substring-after($inst-instr,'esac&#xA;')"/>
             </xsl:call-template>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:when>
       <xsl:otherwise>
+        <!-- normal case: everything that is before popd -->
         <xsl:copy-of select="substring-before($inst-instr,'popd')"/>
       </xsl:otherwise>
     </xsl:choose>