[osinfo-db PATCH v2 10/14] fedora: Prefer user set URL over the default one

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

 



Similarly to what already has been done for CentOS and RHEL, let's
prefer a user set URL (or the URL set for the tree) whenever those are
available.

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

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 .../fedora-kickstart-desktop.xml.in           | 26 ++++++++++++++++++-
 .../fedora-kickstart-jeos.xml.in              | 26 ++++++++++++++++++-
 2 files changed, 50 insertions(+), 2 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 dcdb93f..f918938 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
@@ -110,6 +110,30 @@
           <xsl:value-of select="script/expected-filename"/>
         </xsl:template>
 
+        <xsl:template name="installation-url">
+          <xsl:choose>
+            <xsl:when test="config/installation-url != ''">
+              <xsl:value-of select="config/installation-url"/>
+            </xsl:when>
+            <xsl:when test="tree/url != ''">
+              <xsl:value-of select="tree/url"/>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:template>
+
+        <xsl:template name="url-or-mirrorlist">
+          <xsl:choose>
+            <xsl:when test="config/installation-url != '' or tree/url != ''">
+              <xsl:text> --url</xsl:text>
+              <xsl:call-template name="installation-url"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text> --mirrorlist=</xsl:text>
+              <xsl:text>https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:template>
+
         <xsl:template match="/install-script-config">
 # Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
 <xsl:if test="script/installation-source = 'media' and (count(media/variant) = 0 or not(contains(media/variant, 'netinst')))">
@@ -143,7 +167,7 @@ reboot
 <xsl:if test="script/installation-source = 'network' or contains(media/variant, 'netinst')">
 repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
 repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&amp;arch=$basearch
-url --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
+url <xsl:call-template name="url-or-mirrorlist"/>
 </xsl:if>
 
 %packages
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 07fc932..5b5fe8e 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
@@ -102,6 +102,30 @@
           <xsl:value-of select="script/expected-filename"/>
         </xsl:template>
 
+        <xsl:template name="installation-url">
+          <xsl:choose>
+            <xsl:when test="config/installation-url != ''">
+              <xsl:value-of select="config/installation-url"/>
+            </xsl:when>
+            <xsl:when test="tree/url != ''">
+              <xsl:value-of select="tree/url"/>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:template>
+
+        <xsl:template name="url-or-mirrorlist">
+          <xsl:choose>
+            <xsl:when test="config/installation-url != '' or tree/url != ''">
+              <xsl:text> --url</xsl:text>
+              <xsl:call-template name="installation-url"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text> --mirrorlist=</xsl:text>
+              <xsl:text>https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:template>
+
         <xsl:template match="/install-script-config">
 # Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
 <xsl:if test="script/installation-source='media' and (count(media/variant) = 0 or not(contains(media/variant, 'netinst')))">
@@ -153,7 +177,7 @@ reboot
 <xsl:if test="script/installation-source='network' or contains(media/variant, 'netinst')">
 repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
 repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&amp;arch=$basearch
-url --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
+url <xsl:call-template name="url-or-mirrorlist"/>
 </xsl:if>
 
 %packages
-- 
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