[jhalfs] 01/03: Allow to store version of -pass1 packages

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

commit a6fbc65357946601983215b0a2d2f5ce227a52fd
Author: Pierre Labastie <[email protected]>
AuthorDate: Thu Dec 16 10:26:43 2021 +0100

    Allow to store version of -pass1 packages
    
    With the new way of treating dependencies, we need to properly
    manage -pass1 packages: For that we need the installed version of
    -pass1 packages. But it is recorded nowhere. packages.xml shouldn't
    be used for that, because it is directly built from the book
    dependencies: adding -pass1 packages would just duplicate the
    dependency information. So the version has to be recorded in
    the tracking file. This involves changing bump.xsl (this commit),
    and passing the tracking file to gen_pkg_book (next commit).
---
 BLFS/xsl/bump.xsl | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/BLFS/xsl/bump.xsl b/BLFS/xsl/bump.xsl
index c555069..146d972 100644
--- a/BLFS/xsl/bump.xsl
+++ b/BLFS/xsl/bump.xsl
@@ -7,15 +7,26 @@
   <xsl:param name="package" select="''"/>
   <xsl:param name="version" select="'N'"/>
 
+  <xsl:variable name="realpackage">
+    <xsl:choose>
+      <xsl:when test="contains($package, '-pass1')">
+        <xsl:copy-of select="substring-before($package, '-pass1')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$package"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:variable name="vers">
     <xsl:choose>
       <xsl:when test="$version='N'">
         <xsl:value-of select=
             "document($packages)//*[self::package or self::module]
-                                   [string(name)=$package]/version"/>
+                                   [string(name)=$realpackage]/version"/>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$version"/>
+        <xsl:copy-of select="$version"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
@@ -31,8 +42,8 @@
       <xsl:apply-templates select=".//package"/>
       <xsl:if test="not(.//package[string(name)=$package])">
         <package>
-          <name><xsl:value-of select="$package"/></name>
-          <version><xsl:value-of select="$vers"/></version>
+          <name><xsl:copy-of select="$package"/></name>
+          <version><xsl:copy-of select="$vers"/></version>
         </package>
       </xsl:if>
     </sublist>
@@ -42,8 +53,8 @@
     <xsl:choose>
       <xsl:when test="string(name)=$package">
         <package>
-          <name><xsl:value-of select="name"/></name>
-          <version><xsl:value-of select="$vers"/></version>
+          <name><xsl:copy-of select="$package"/></name>
+          <version><xsl:copy-of select="$vers"/></version>
         </package>
       </xsl:when>
       <xsl:otherwise>

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

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.