[jhalfs] branch trunk updated: BLFS tools: don't generate duplicate download code

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <166878281973.12350.17547585664490149939@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new 0f4df7c  BLFS tools: don't generate duplicate download code
0f4df7c is described below

commit 0f4df7ccfde2e9c1cb834ca687a5c69b307d06e0
Author: Pierre Labastie <[email protected]>
AuthorDate: Fri Nov 18 15:36:07 2022 +0100

    BLFS tools: don't generate duplicate download code
    
    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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.