Changeset dcb91d8 for stylesheets


Ignore:
Timestamp:
01/26/2005 09:32:52 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
bf647e7
Parents:
42e4d3f
Message:

Updated patcheslist.xsl.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4561 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/patcheslist.xsl

    r42e4d3f rdcb91d8  
    55]>
    66
    7 <!-- To work against BLFS some changes are needed -->
    8 
    97<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    108                version="1.0">
     
    1210  <xsl:output method="text"/>
    1311
    14   <xsl:param name="links.directory">
    15     <xsl:value-of select="substring-after('&patches-root;', 'patches/')"/>
     12    <!-- Allow select the dest dir at runtime -->
     13  <xsl:param name="dest.dir">
     14    <xsl:value-of select="concat('/home/httpd/', substring-after('&patches-root;', 'http://'))"/>
    1615  </xsl:param>
    1716
    1817  <xsl:template match="/">
    19     <xsl:text>#! /bin/bash&#x0a;</xsl:text>
    20     <xsl:text>&#x0a;  cd /home/httpd/</xsl:text>
    21     <xsl:value-of select="substring-after('&patches-root;', 'http://')"/>
     18    <xsl:text>#! /bin/bash&#x0a;&#x0a;</xsl:text>
     19      <!-- Create dest.dir if it don't exist -->
     20    <xsl:text>  mkdir -p </xsl:text>
     21    <xsl:value-of select="$dest.dir"/>
     22    <xsl:text> &amp;&amp;&#x0a;</xsl:text>
     23    <xsl:text>  cd </xsl:text>
     24    <xsl:value-of select="$dest.dir"/>
    2225    <xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
    23     <xsl:text>  rm -f *.patch &amp;&amp;&#x0a;&#x0a;</xsl:text>
     26      <!-- Touch a dummy patch to prevent fails if dest dir is empty, then remove old patches -->
     27    <xsl:text>  touch dummy.patch &amp;&amp;&#x0a;  rm -f *.patch &amp;&amp;&#x0a;&#x0a;</xsl:text>
    2428    <xsl:apply-templates/>
     29      <!-- Ensure correct owneship -->
    2530    <xsl:text>&#x0a;  chgrp lfswww *.patch &amp;&amp;&#x0a;</xsl:text>
    2631    <xsl:text>&#x0a;  exit&#x0a;</xsl:text>
    2732  </xsl:template>
    2833
    29   <xsl:template match="//text()">
    30     <xsl:text/>
    31   </xsl:template>
     34  <xsl:template match="//text()"/>
    3235
    3336  <xsl:template match="//ulink">
    34     <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')">
    35       <xsl:choose>
    36         <xsl:when test="ancestor-or-self::*/@condition = 'pdf'"/>
    37         <xsl:otherwise>
    38           <xsl:text>  cp </xsl:text>
    39           <xsl:text>/home/httpd/</xsl:text>
    40           <xsl:value-of select="substring-before (substring-after ('&patches-root;', 'http://'), $links.directory)"/>
    41           <xsl:text>downloads/</xsl:text>
    42           <xsl:if test="contains (@url, '-')">
    43             <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/>
    44             <xsl:variable name="links.directory2" select="translate ($links.directory, '0123456789', '2222222222')"/>
    45             <xsl:choose>
    46               <xsl:when test="contains ($cut, ',')">
    47                 <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), ',2')"/>
    48               </xsl:when>
    49               <xsl:otherwise>
    50                 <xsl:choose>
    51                   <xsl:when test="contains ($cut, '-src-2')">
    52                     <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-src-2')"/>
    53                   </xsl:when>
    54                   <xsl:otherwise>
    55                     <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-2')"/>
    56                   </xsl:otherwise>
    57                 </xsl:choose>
    58               </xsl:otherwise>
    59             </xsl:choose>
    60           </xsl:if>
    61           <xsl:text>/</xsl:text>
    62           <xsl:value-of select="substring-after(@url, $links.directory)"/>
    63           <xsl:text> . &#x0a;</xsl:text>
    64         </xsl:otherwise>
    65       </xsl:choose>
     37      <!-- Match only local patches links and skip duplicated URLs splitted for PDF output-->
     38    <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')
     39            and not(ancestor-or-self::*/@condition = 'pdf')">
     40      <xsl:variable name="patch.name" select="substring-after(@url, '&patches-root;')"/>
     41      <xsl:variable name="cut"
     42              select="translate(substring-after($patch.name, '-'), '0123456789', '0000000000')"/>
     43      <xsl:variable name="patch.name2">
     44        <xsl:value-of select="substring-before($patch.name, '-')"/>
     45        <xsl:text>-</xsl:text>
     46        <xsl:value-of select="$cut"/>
     47      </xsl:variable>
     48      <xsl:text>  cp /home/httpd/www.linuxfromscratch.org/patches/downloads/</xsl:text>
     49          <xsl:value-of select="substring-before($patch.name2, '-0')"/>
     50      <xsl:text>/</xsl:text>
     51      <xsl:value-of select="$patch.name"/>
     52      <xsl:text> . &#x0a;</xsl:text>
    6653    </xsl:if>
    6754  </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.