jhalfs git · trunk
jhalfs LFS build automation (mirror)
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.gzBLFS 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