Nimbin[12]?Mirrors & Forks / jhalfs / commits / 0f4df7c

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

BLFS tools: don't generate duplicate download code

Pierre Labastie · 2022-11-18 14:36 · 0f4df7ccfde2e9c1cb834ca687a5c69b307d06e0

For additional downloads, the normal book layout is a <bridgehead>
containing "Additional Downloads" followed by one or more
<itemizedlist>, one for each file to download. But on some pages,
there are several <bridgehead>, each followed by one or more
<itemizedlist>. So we have to check that only the <itemizedlist>
correponding to the current <bridgehead> are treated. Otherwise,
the download code may be generated more than once. This imposes
that no other bridgehead is inserted between the one containing
"Additional" (or in some case "Recommended/Optional Download") and
the <itemizedlist>.
 BLFS/xsl/scripts.xsl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl
index 5561af7..cb0cc70 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -538,16 +538,19 @@ echo "</xsl:text>
       <!-- Additional package information -->
       <!-- special cases for llvm -->
       <xsl:when test="contains(string(),'Recommended Download')">
-        <xsl:apply-templates select="following-sibling::itemizedlist[1]"
+        <xsl:apply-templates select="following-sibling::itemizedlist
+                             [preceding-sibling::bridgehead[1]=current()]"
                              mode="additional"/>
       </xsl:when>
       <xsl:when test="contains(string(),'Optional Download')">
-        <xsl:apply-templates select="following-sibling::itemizedlist"
+        <xsl:apply-templates select="following-sibling::itemizedlist
+                             [preceding-sibling::bridgehead[1]=current()]"
                              mode="additional"/>
       </xsl:when>
       <!-- All other additional packages have "Additional" -->
       <xsl:when test="contains(string(),'Additional')">
-        <xsl:apply-templates select="following-sibling::itemizedlist"
+        <xsl:apply-templates select="following-sibling::itemizedlist
+                             [preceding-sibling::bridgehead[1]=current()]"
                              mode="additional"/>
       </xsl:when>
       <!-- Do not do anything if the dev has created another type of