[osinfo-db PATCH 2/2] install-script, rhel: Only add install-source if there's an install URL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When dealing with net-install ISOs, we may reach the situation where
the command-line template will generate the command-line adding a
"inst.repo=" but the installation URL is not present.

The easiest way to deal with this is checking whether an installation
URL is present and only adding "inst.repo=" if that's the case.

https://gitlab.com/libosinfo/osinfo-db/issues/29

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 .../redhat.com/rhel-kickstart-desktop.xml.in               | 7 +++++--
 data/install-script/redhat.com/rhel-kickstart-jeos.xml.in  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in b/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
index 3a3a370..d0788e8 100644
--- a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
+++ b/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
@@ -93,7 +93,10 @@
             </xsl:otherwise>
           </xsl:choose>
           <xsl:value-of select="script/expected-filename"/>
-          <xsl:if test="script/installation-source = 'network'">
+          <xsl:variable name="installation-url">
+            <xsl:call-template name="installation-url"/>
+          </xsl:variable>
+          <xsl:if test="script/installation-source = 'network' and $installation-url != ''">
             <xsl:choose>
               <xsl:when test="os/version &lt; 7">
                 <xsl:text> method=</xsl:text>
@@ -102,7 +105,7 @@
                 <xsl:text> inst.repo=</xsl:text>
               </xsl:otherwise>
             </xsl:choose>
-            <xsl:call-template name="installation-url"/>
+            <xsl:value-of select="$installation-url"/>
           </xsl:if>
         </xsl:template>
 
diff --git a/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in b/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
index fdef836..f1ffb43 100644
--- a/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
+++ b/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
@@ -69,7 +69,10 @@
             </xsl:otherwise>
           </xsl:choose>
           <xsl:value-of select="script/expected-filename"/>
-          <xsl:if test="script/installation-source = 'network'">
+          <xsl:variable name="installation-url">
+            <xsl:call-template name="installation-url"/>
+          </xsl:variable>
+          <xsl:if test="script/installation-source = 'network' and $installation-url != ''">
             <xsl:choose>
               <xsl:when test="os/version &lt; 7">
                 <xsl:text> method=</xsl:text>
@@ -78,7 +81,7 @@
                 <xsl:text> inst.repo=</xsl:text>
               </xsl:otherwise>
             </xsl:choose>
-            <xsl:call-template name="installation-url"/>
+            <xsl:value-of select="$installation-url"/>
           </xsl:if>
         </xsl:template>
 
-- 
2.21.0

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux