mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2026-07-16 15:48:58 -04:00
Make wget-list.xsl and md5sums.xsl more robust
Those stylesheets selected download urls by seeking some pattern in their content. Those patterns may need to be adjusted if a new type of file is downloaded. We prefer to seek urls inside <para> containing "Download", which is the norm in chapter 3. The condition is also that those <para> are in a <listitem>.
This commit is contained in:
@@ -8,18 +8,14 @@
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="//ulink"/>
|
||||
<xsl:apply-templates select="//listitem/para[contains(string(),'Download')]/ulink"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ulink">
|
||||
<!-- If some package don't have the predefined strings in their
|
||||
name, the next test must be fixed to match it also. Skip possible
|
||||
duplicated URLs that may be split for PDF output -->
|
||||
<xsl:if test="( (contains( @url, '.tar.' ) and not( ancestor::note ) ) or
|
||||
contains( @url, '.zip' ) or
|
||||
contains( @url, '.patch' )
|
||||
) and
|
||||
not( ancestor-or-self::*/@condition = 'pdf' )" >
|
||||
<xsl:if test="not( ancestor-or-self::*/@condition = 'pdf' )" >
|
||||
<!-- Get the md5sum -->
|
||||
<xsl:value-of select="../../para/literal"/>
|
||||
|
||||
|
||||
@@ -9,18 +9,14 @@
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="//ulink"/>
|
||||
<xsl:apply-templates select="//listitem/para[contains(string(),'Download')]/ulink"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ulink">
|
||||
<!-- If some package don't have the predefined strings in their
|
||||
name, the next test must be fixed to match it also. Skip possible
|
||||
duplicated URLs due that may be split for PDF output -->
|
||||
<xsl:if test="( (contains(@url, '.tar.') and not( ancestor::note ) ) or
|
||||
contains(@url, '.zip' ) or
|
||||
contains(@url, '.patch')
|
||||
) and
|
||||
not(ancestor-or-self::*/@condition = 'pdf')">
|
||||
<xsl:if test="not(ancestor-or-self::*/@condition = 'pdf')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(@url,'?download')">
|
||||
<xsl:value-of select="substring-before(@url,'?download')"/>
|
||||
|
||||
Reference in New Issue
Block a user