r2089 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Oct 8 07:52:38 PDT 2005


Author: manuel
Date: 2005-10-08 08:52:37 -0600 (Sat, 08 Oct 2005)
New Revision: 2089

Modified:
   jhalfs/trunk/dump-lfs-scripts.xsl
Log:
Fixed a bug in the creation of "cat ... EOF" blocks, found when creating /usr/bin/lex in 081-flex.

Modified: jhalfs/trunk/dump-lfs-scripts.xsl
===================================================================
--- jhalfs/trunk/dump-lfs-scripts.xsl	2005-10-08 10:35:21 UTC (rev 2088)
+++ jhalfs/trunk/dump-lfs-scripts.xsl	2005-10-08 14:52:37 UTC (rev 2089)
@@ -124,15 +124,16 @@
         </xsl:choose>
       </xsl:when>
       <xsl:when test="contains(string(),'EOF')">
-        <xsl:variable name="content">
-          <xsl:apply-templates/>
-        </xsl:variable>
-        <xsl:value-of select="substring-before(string($content), 'cat >')"/>
-        <xsl:text>&#xA;(&#xA;cat << EOF</xsl:text>
-        <xsl:value-of select="substring-after(string($content), '"EOF"')"/>
-        <xsl:text>&#xA;) ></xsl:text>
-        <xsl:value-of select="substring-after((substring-before(string($content), '<<')), 'cat >')"/>
+        <xsl:value-of select="substring-before(string(),'cat >')"/>
+        <xsl:text>&#xA;(&#xA;cat << EOF&#xA;</xsl:text>
+        <xsl:apply-templates select="literal"/>
+        <xsl:text>&#xA;EOF&#xA;) ></xsl:text>
+        <xsl:value-of select="substring-after((substring-before(string(),'<<')),'cat >')"/>
         <xsl:text> &&&#xA;</xsl:text>
+        <xsl:if test="string-length(substring-after(string(),'EOF&#xA;')) > 0">
+          <xsl:value-of select="substring-after(string(),'EOF&#xA;')"/>
+          <xsl:text> &&&#xA;</xsl:text>
+        </xsl:if>
       </xsl:when>
       <xsl:otherwise>
         <xsl:apply-templates/>
@@ -145,6 +146,22 @@
     </xsl:choose>
   </xsl:template>
 
+  <xsl:template match="literal">
+    <xsl:choose>
+      <xsl:when test="contains(string(),'$@')">
+        <xsl:variable name="content">
+          <xsl:apply-templates/>
+        </xsl:variable>
+        <xsl:value-of select="substring-before(string($content),'$@')"/>
+        <xsl:text>\$@</xsl:text>
+        <xsl:value-of select="substring-after(string($content),'$@')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
   <xsl:template match="replaceable">
     <xsl:choose>
       <xsl:when test="ancestor::sect1[@id='ch-system-groff']">




More information about the alfs-log mailing list