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>.
This commit is contained in:
Pierre Labastie 2022-11-18 15:36:07 +01:00
parent ed335a3113
commit 0f4df7ccfd

View file

@ -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