Changeset ddb0feb for BLFS/xsl


Ignore:
Timestamp:
10/21/2023 07:47:14 PM (9 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
bacbb07
Parents:
faa6594
Message:

Fix: packages with similar names in kf5 and plasma

When this is the case they are both installed.
We need to check exact names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/make_book.xsl

    rfaa6594 rddb0feb  
    512512      </xsl:call-template>
    513513    </xsl:variable>
    514     <xsl:variable name="md5sum">
    515       <xsl:call-template name="md5sum">
    516         <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
    517         <xsl:with-param name="cat-md5"
    518                         select=".//userinput[starts-with(string(),'cat ')]"/>
    519       </xsl:call-template>
    520     </xsl:variable>
    521     <xsl:variable name="download-dir">
    522       <xsl:call-template name="download-dir">
    523         <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
    524         <xsl:with-param name="cat-md5"
    525                         select=".//userinput[starts-with(string(),'cat ')]"/>
    526       </xsl:call-template>
    527     </xsl:variable>
    528     <xsl:variable name="install-instructions">
    529       <xsl:call-template name="inst-instr">
    530         <xsl:with-param name="inst-instr"
    531           select=
    532             "substring-after(
    533                substring-after(.//userinput[starts-with(string(),'for ') or
    534                                             starts-with(string(),'while ')],
    535                                'pushd'),
    536                '&#xA;')"/>
    537         <xsl:with-param name="package" select="$package"/>
    538       </xsl:call-template>
    539     </xsl:variable>
    540     <xsl:element name="sect1">
    541       <xsl:attribute name="id"><xsl:value-of select="$package"/></xsl:attribute>
    542       <xsl:processing-instruction name="dbhtml">
    543          filename="<xsl:value-of select='$package'/>.html"
    544       </xsl:processing-instruction>
    545       <title><xsl:value-of select="$package"/></title>
    546       <sect2 role="package">
    547         <title>Introduction to <xsl:value-of select="$package"/></title>
    548         <bridgehead renderas="sect3">Package Information</bridgehead>
    549         <itemizedlist spacing="compact">
    550           <listitem>
    551             <para>Download (HTTP): <xsl:element name="ulink">
    552               <xsl:attribute name="url">
    553                 <xsl:value-of
    554                    select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
    555                 <xsl:value-of select="$download-dir"/>
    556                 <xsl:if test="contains(@id,'frameworks') or
    557                               contains(@id,'plasma5')">
    558                   <xsl:text>/</xsl:text>
    559                 </xsl:if>
    560                 <xsl:value-of select="$tarball"/>
    561               </xsl:attribute>
    562              </xsl:element>
    563             </para>
    564           </listitem>
    565           <listitem>
    566             <para>Download (FTP): <ulink url=" "/>
    567             </para>
    568           </listitem>
    569           <listitem>
    570             <para>
    571               Download MD5 sum: <xsl:value-of select="$md5sum"/>
    572             </para>
    573           </listitem>
    574         </itemizedlist>
    575         <!-- If there is an additional download, we need to output that -->
    576         <xsl:if test=".//bridgehead[contains(string(),'Additional')]">
    577           <xsl:copy-of
    578                  select=".//bridgehead[contains(string(),'Additional')]"/>
    579           <xsl:copy-of
    580                  select=".//bridgehead[contains(string(),'Additional')]
    581                          /following-sibling::itemizedlist[1]"/>
    582         </xsl:if>
    583       </sect2>
    584       <sect2 role="installation">
    585         <title>Installation of <xsl:value-of select="$package"/></title>
    586 
    587         <para>
    588           Install <application><xsl:value-of select="$package"/></application>
    589           by running the following commands:
    590         </para>
    591 
    592         <screen><userinput>packagedir=<xsl:value-of
    593                     select="substring-before($tarball,'.tar.')"/>
    594           <xsl:text>
    595      name=$(echo $pkg | sed 's/-[[:digit:]].*//')
    596           </xsl:text>
    597           <xsl:value-of select="substring-before($install-instructions,
    598                                                  'as_root')"/>
    599         </userinput></screen>
    600 
    601         <para>
    602           Now as the <systemitem class="username">root</systemitem> user:
    603         </para>
    604         <screen role='root'>
    605           <userinput><xsl:value-of select="substring-after(
    606                                                  $install-instructions,
    607                                                  'as_root')"/>
    608           </userinput>
    609         </screen>
    610       </sect2>
    611     </xsl:element><!-- sect1 -->
     514    <!-- Unfortunately, there are packages in kf5 and plasma5 that
     515         starts in the same way: for example kwallet in kf5
     516         and kwallet-pam in plasma. So we may arrive here with
     517         package=kwallet and tarball=kwallet-pam-(version).tar.xz.
     518         We should not continue in this case. For checking, transform
     519         digits into X, and check that package-X occurs in tarball.-->
     520    <xsl:if test="contains(translate($tarball,'0123456789','XXXXXXXXXX'),
     521                           concat($package,'-X'))">
     522      <xsl:variable name="md5sum">
     523        <xsl:call-template name="md5sum">
     524          <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
     525          <xsl:with-param name="cat-md5"
     526                          select=".//userinput[starts-with(string(),'cat ')]"/>
     527        </xsl:call-template>
     528      </xsl:variable>
     529      <xsl:variable name="download-dir">
     530        <xsl:call-template name="download-dir">
     531          <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
     532          <xsl:with-param name="cat-md5"
     533                          select=".//userinput[starts-with(string(),'cat ')]"/>
     534        </xsl:call-template>
     535      </xsl:variable>
     536      <xsl:variable name="install-instructions">
     537        <xsl:call-template name="inst-instr">
     538          <xsl:with-param name="inst-instr"
     539            select=
     540              "substring-after(
     541                 substring-after(.//userinput[starts-with(string(),'for ') or
     542                                              starts-with(string(),'while ')],
     543                                 'pushd'),
     544                 '&#xA;')"/>
     545          <xsl:with-param name="package" select="$package"/>
     546        </xsl:call-template>
     547      </xsl:variable>
     548      <xsl:element name="sect1">
     549        <xsl:attribute name="id">
     550          <xsl:value-of select="$package"/>
     551        </xsl:attribute>
     552        <xsl:processing-instruction name="dbhtml">
     553           filename="<xsl:value-of select='$package'/>.html"
     554        </xsl:processing-instruction>
     555        <title><xsl:value-of select="$package"/></title>
     556        <sect2 role="package">
     557          <title>Introduction to <xsl:value-of select="$package"/></title>
     558          <bridgehead renderas="sect3">Package Information</bridgehead>
     559          <itemizedlist spacing="compact">
     560            <listitem>
     561              <para>Download (HTTP): <xsl:element name="ulink">
     562                <xsl:attribute name="url">
     563                  <xsl:value-of
     564                     select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
     565                  <xsl:value-of select="$download-dir"/>
     566                  <!-- $download-dir contains the trailing / for xorg,
     567                       but not for KDE... -->
     568                  <xsl:if test="contains(@id,'frameworks') or
     569                                contains(@id,'plasma5')">
     570                    <xsl:text>/</xsl:text>
     571                  </xsl:if>
     572                  <xsl:value-of select="$tarball"/>
     573                </xsl:attribute>
     574               </xsl:element>
     575              </para>
     576            </listitem>
     577            <!-- don't use FTP, although they are available for xorg -->
     578            <listitem>
     579              <para>Download (FTP): <ulink url=" "/>
     580              </para>
     581            </listitem>
     582            <listitem>
     583              <para>
     584                Download MD5 sum: <xsl:value-of select="$md5sum"/>
     585              </para>
     586            </listitem>
     587          </itemizedlist>
     588          <!-- If there is an additional download, we need to output that -->
     589          <xsl:if test=".//bridgehead[contains(string(),'Additional')]">
     590            <xsl:copy-of
     591                   select=".//bridgehead[contains(string(),'Additional')]"/>
     592            <xsl:copy-of
     593                   select=".//bridgehead[contains(string(),'Additional')]
     594                           /following-sibling::itemizedlist[1]"/>
     595          </xsl:if>
     596        </sect2>
     597        <sect2 role="installation">
     598          <title>Installation of <xsl:value-of select="$package"/></title>
     599
     600          <para>
     601            Install <application><xsl:value-of select="$package"/></application>
     602            by running the following commands:
     603          </para>
     604          <!-- packagedir is used in xorg lib instructions -->
     605          <screen><userinput>packagedir=<xsl:value-of
     606                      select="substring-before($tarball,'.tar.')"/>
     607           <!-- name is used in kf5 instructions -->
     608            <xsl:text>
     609name=$(echo $packagedir | sed 's/-[[:digit:]].*//')
     610</xsl:text>
     611            <xsl:value-of select="substring-before($install-instructions,
     612                                                   'as_root')"/>
     613          </userinput></screen>
     614
     615          <para>
     616            Now as the <systemitem class="username">root</systemitem> user:
     617          </para>
     618          <screen role='root'>
     619            <userinput><xsl:value-of select="substring-after(
     620                                                   $install-instructions,
     621                                                   'as_root')"/>
     622            </userinput>
     623          </screen>
     624        </sect2>
     625      </xsl:element><!-- sect1 -->
     626    </xsl:if>
    612627
    613628  </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.