[jhalfs] 02/03: Fix: packages with similar names in kf5 and plasma

"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 ablfs-more
in repository jhalfs.

commit ddb0feba47fa9419afa9c7cfd254a6f9691e3320
Author: Pierre Labastie <[email protected]>
AuthorDate: Sat Oct 21 21:47:14 2023 +0200

    Fix: packages with similar names in kf5 and plasma
    
    When this is the case they are both installed.
    We need to check exact names.
---
 BLFS/xsl/make_book.xsl | 207 ++++++++++++++++++++++++++-----------------------
 1 file changed, 111 insertions(+), 96 deletions(-)

diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl
index fc79e14..42b268a 100644
--- a/BLFS/xsl/make_book.xsl
+++ b/BLFS/xsl/make_book.xsl
@@ -511,104 +511,119 @@
                         select="string(.//userinput[starts-with(string(),'cat ')])"/>
       </xsl:call-template>
     </xsl:variable>
-    <xsl:variable name="md5sum">
-      <xsl:call-template name="md5sum">
-        <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
-        <xsl:with-param name="cat-md5"
-                        select=".//userinput[starts-with(string(),'cat ')]"/>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:variable name="download-dir">
-      <xsl:call-template name="download-dir">
-        <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
-        <xsl:with-param name="cat-md5"
-                        select=".//userinput[starts-with(string(),'cat ')]"/>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:variable name="install-instructions">
-      <xsl:call-template name="inst-instr">
-        <xsl:with-param name="inst-instr"
-          select=
-            "substring-after(
-               substring-after(.//userinput[starts-with(string(),'for ') or
-                                            starts-with(string(),'while ')],
-                               'pushd'),
-               '&#xA;')"/>
-        <xsl:with-param name="package" select="$package"/>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:element name="sect1">
-      <xsl:attribute name="id"><xsl:value-of select="$package"/></xsl:attribute>
-      <xsl:processing-instruction name="dbhtml">
-         filename="<xsl:value-of select='$package'/>.html"
-      </xsl:processing-instruction>
-      <title><xsl:value-of select="$package"/></title>
-      <sect2 role="package">
-        <title>Introduction to <xsl:value-of select="$package"/></title>
-        <bridgehead renderas="sect3">Package Information</bridgehead>
-        <itemizedlist spacing="compact">
-          <listitem>
-            <para>Download (HTTP): <xsl:element name="ulink">
-              <xsl:attribute name="url">
-                <xsl:value-of
-                   select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
-                <xsl:value-of select="$download-dir"/>
-                <xsl:if test="contains(@id,'frameworks') or
-                              contains(@id,'plasma5')">
-                  <xsl:text>/</xsl:text>
-                </xsl:if>
-                <xsl:value-of select="$tarball"/>
-              </xsl:attribute>
-             </xsl:element>
-            </para>
-          </listitem>
-          <listitem>
-            <para>Download (FTP): <ulink url=" "/>
-            </para>
-          </listitem>
-          <listitem>
-            <para>
-              Download MD5 sum: <xsl:value-of select="$md5sum"/>
-            </para>
-          </listitem>
-        </itemizedlist>
-        <!-- If there is an additional download, we need to output that -->
-        <xsl:if test=".//bridgehead[contains(string(),'Additional')]">
-          <xsl:copy-of
-                 select=".//bridgehead[contains(string(),'Additional')]"/>
-          <xsl:copy-of
-                 select=".//bridgehead[contains(string(),'Additional')]
-                         /following-sibling::itemizedlist[1]"/>
-        </xsl:if>
-      </sect2>
-      <sect2 role="installation">
-        <title>Installation of <xsl:value-of select="$package"/></title>
-
-        <para>
-          Install <application><xsl:value-of select="$package"/></application>
-          by running the following commands:
-        </para>
+    <!-- Unfortunately, there are packages in kf5 and plasma5 that
+         starts in the same way: for example kwallet in kf5
+         and kwallet-pam in plasma. So we may arrive here with
+         package=kwallet and tarball=kwallet-pam-(version).tar.xz.
+         We should not continue in this case. For checking, transform
+         digits into X, and check that package-X occurs in tarball.-->
+    <xsl:if test="contains(translate($tarball,'0123456789','XXXXXXXXXX'),
+                           concat($package,'-X'))">
+      <xsl:variable name="md5sum">
+        <xsl:call-template name="md5sum">
+          <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
+          <xsl:with-param name="cat-md5"
+                          select=".//userinput[starts-with(string(),'cat ')]"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="download-dir">
+        <xsl:call-template name="download-dir">
+          <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
+          <xsl:with-param name="cat-md5"
+                          select=".//userinput[starts-with(string(),'cat ')]"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="install-instructions">
+        <xsl:call-template name="inst-instr">
+          <xsl:with-param name="inst-instr"
+            select=
+              "substring-after(
+                 substring-after(.//userinput[starts-with(string(),'for ') or
+                                              starts-with(string(),'while ')],
+                                 'pushd'),
+                 '&#xA;')"/>
+          <xsl:with-param name="package" select="$package"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:element name="sect1">
+        <xsl:attribute name="id">
+          <xsl:value-of select="$package"/>
+        </xsl:attribute>
+        <xsl:processing-instruction name="dbhtml">
+           filename="<xsl:value-of select='$package'/>.html"
+        </xsl:processing-instruction>
+        <title><xsl:value-of select="$package"/></title>
+        <sect2 role="package">
+          <title>Introduction to <xsl:value-of select="$package"/></title>
+          <bridgehead renderas="sect3">Package Information</bridgehead>
+          <itemizedlist spacing="compact">
+            <listitem>
+              <para>Download (HTTP): <xsl:element name="ulink">
+                <xsl:attribute name="url">
+                  <xsl:value-of
+                     select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
+                  <xsl:value-of select="$download-dir"/>
+                  <!-- $download-dir contains the trailing / for xorg,
+                       but not for KDE... -->
+                  <xsl:if test="contains(@id,'frameworks') or
+                                contains(@id,'plasma5')">
+                    <xsl:text>/</xsl:text>
+                  </xsl:if>
+                  <xsl:value-of select="$tarball"/>
+                </xsl:attribute>
+               </xsl:element>
+              </para>
+            </listitem>
+            <!-- don't use FTP, although they are available for xorg -->
+            <listitem>
+              <para>Download (FTP): <ulink url=" "/>
+              </para>
+            </listitem>
+            <listitem>
+              <para>
+                Download MD5 sum: <xsl:value-of select="$md5sum"/>
+              </para>
+            </listitem>
+          </itemizedlist>
+          <!-- If there is an additional download, we need to output that -->
+          <xsl:if test=".//bridgehead[contains(string(),'Additional')]">
+            <xsl:copy-of
+                   select=".//bridgehead[contains(string(),'Additional')]"/>
+            <xsl:copy-of
+                   select=".//bridgehead[contains(string(),'Additional')]
+                           /following-sibling::itemizedlist[1]"/>
+          </xsl:if>
+        </sect2>
+        <sect2 role="installation">
+          <title>Installation of <xsl:value-of select="$package"/></title>
 
-        <screen><userinput>packagedir=<xsl:value-of
-                    select="substring-before($tarball,'.tar.')"/>
-          <xsl:text>
-     name=$(echo $pkg | sed 's/-[[:digit:]].*//')
-          </xsl:text>
-          <xsl:value-of select="substring-before($install-instructions,
-                                                 'as_root')"/>
-        </userinput></screen>
+          <para>
+            Install <application><xsl:value-of select="$package"/></application>
+            by running the following commands:
+          </para>
+          <!-- packagedir is used in xorg lib instructions -->
+          <screen><userinput>packagedir=<xsl:value-of
+                      select="substring-before($tarball,'.tar.')"/>
+           <!-- name is used in kf5 instructions -->
+            <xsl:text>
+name=$(echo $packagedir | sed 's/-[[:digit:]].*//')
+</xsl:text>
+            <xsl:value-of select="substring-before($install-instructions,
+                                                   'as_root')"/>
+          </userinput></screen>
 
-        <para>
-          Now as the <systemitem class="username">root</systemitem> user:
-        </para>
-        <screen role='root'>
-          <userinput><xsl:value-of select="substring-after(
-                                                 $install-instructions,
-                                                 'as_root')"/>
-          </userinput>
-        </screen>
-      </sect2>
-    </xsl:element><!-- sect1 -->
+          <para>
+            Now as the <systemitem class="username">root</systemitem> user:
+          </para>
+          <screen role='root'>
+            <userinput><xsl:value-of select="substring-after(
+                                                   $install-instructions,
+                                                   'as_root')"/>
+            </userinput>
+          </screen>
+        </sect2>
+      </xsl:element><!-- sect1 -->
+    </xsl:if>
 
   </xsl:template>
 

-- 
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.