[jhalfs] 01/06: BLFS: unquote LFS-Release version

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]> Sat, 25 Apr 2026 16:46:47 +0000
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1777135617-2147-26064
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

commit 22ca4ad29f999f6627c226af5d8a4764bd9b6ef7
Author: Pierre Labastie <[email protected]>
AuthorDate: Sat Apr 25 14:46:03 2026 +0200

    BLFS: unquote LFS-Release version
    
    We take the LFS release version from "echo ... >/etc/lfs-release"
    in the lfs-full book. Problem is with ... content:
    - it may be an unquoted string of non special characters: in
    this case, we need to only take all chars between "space"
    characters
    - it may be a quoted string with possibly special characters
    (space, hash sign, ...). We then need to remove quotes.
    in BLFS tools, it is done in gen_pkg_list.xsl
    Reported by Eric Clothier on alfs-discuss, thanks
---
 BLFS/xsl/gen_pkg_list.xsl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BLFS/xsl/gen_pkg_list.xsl b/BLFS/xsl/gen_pkg_list.xsl
index 4a014ec..1f42caf 100644
--- a/BLFS/xsl/gen_pkg_list.xsl
+++ b/BLFS/xsl/gen_pkg_list.xsl
@@ -72,11 +72,19 @@
   </xsl:template>
 
   <xsl:template match="userinput">
+    <xsl:variable name="quote">"</xsl:variable>
 <!-- Only used in lFS chapter 9, to retrieve book version -->
     <package>
       <name>LFS-Release</name>
       <xsl:element name="version">
-        <xsl:copy-of select="substring-after(substring-before(string(),' &gt;'),'echo ')"/>
+        <xsl:choose>
+          <xsl:when test="contains(string(),string($quote))">
+            <xsl:copy-of select="substring-before(substring-after(string(),string($quote)),string($quote))"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="substring-after(substring-before(string(),' &gt;'),'echo ')"/>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:element>
       <xsl:if
           test="document($installed-packages)//package[name='LFS-Release']">

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

------------=_1777135617-2147-26064
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
------------=_1777135617-2147-26064--