[osinfo-db PATCH 1/2] install-script, fedora: 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>
---
 .../fedoraproject.org/fedora-kickstart-desktop.xml.in      | 7 +++++--
 .../fedoraproject.org/fedora-kickstart-jeos.xml.in         | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
index 33f674c..7a16a42 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
@@ -118,7 +118,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; 19">
                 <xsl:text> method=</xsl:text>
@@ -127,7 +130,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/fedoraproject.org/fedora-kickstart-jeos.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
index 68ece05..8cc8778 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
@@ -113,7 +113,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; 19">
                 <xsl:text> method=</xsl:text>
@@ -122,7 +125,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