[gnome-boxes/update-downloadable-oses: 2/2] wizard-source/downloads: Update to osinfo-db 20181116



commit 2e465fb13aaa959ef8a33b098d9f56bb5e94baf8
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Nov 16 12:52:58 2018 +0100

    wizard-source/downloads: Update to osinfo-db 20181116

 build-aux/flatpak/org.gnome.Boxes.json |  4 +++-
 data/osinfo/meson.build                |  1 +
 data/osinfo/rhel-8.0.xml               | 10 ++++++++++
 data/recommended-downloads.xml         |  9 +++++----
 src/wizard-source.vala                 | 23 +++++++++++++++++++----
 5 files changed, 38 insertions(+), 9 deletions(-)
---
diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
index c2025003..0f7112d4 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -370,7 +370,9 @@
             "buildsystem" : "meson",
             "config-opts" : [
                 "-Dflatpak=true",
-                "-Dprofile=development"
+                "-Dprofile=development",
+                "-Ddistributor_name=gnome-boxes-nightly",
+                "-Ddistributor_version=master"
             ],
             "sources" : [
                 {
diff --git a/data/osinfo/meson.build b/data/osinfo/meson.build
index 20956cf3..6cc2881f 100644
--- a/data/osinfo/meson.build
+++ b/data/osinfo/meson.build
@@ -11,6 +11,7 @@ osinfo_db = [
   ['rhel-5.0.xml', 'gnome-boxes/osinfo/os/redhat.com'],
   ['rhel-6.0.xml', 'gnome-boxes/osinfo/os/redhat.com'],
   ['rhel-7.0.xml', 'gnome-boxes/osinfo/os/redhat.com'],
+  ['rhel-8.0.xml', 'gnome-boxes/osinfo/os/redhat.com'],
   ['silverblue-28.xml', 'gnome-boxes/osinfo/os/fedoraproject.org']
 ]
 
diff --git a/data/osinfo/rhel-8.0.xml b/data/osinfo/rhel-8.0.xml
new file mode 100644
index 00000000..cd692781
--- /dev/null
+++ b/data/osinfo/rhel-8.0.xml
@@ -0,0 +1,10 @@
+<libosinfo version="0.0.1">
+
+  <!-- Please read README.logos for any questions about usage of product logos in Boxes. !-->
+
+  <os id="http://redhat.com/rhel/8.0";>
+    <name>Red Hat Enterprise Linux 8 (Beta)</name>
+    <logo>https://gitlab.gnome.org/GNOME/gnome-boxes-logos/raw/master/logos/shadownman-pill.svg</logo>
+  </os>
+
+</libosinfo>
diff --git a/data/recommended-downloads.xml b/data/recommended-downloads.xml
index 010f2132..37a4b790 100644
--- a/data/recommended-downloads.xml
+++ b/data/recommended-downloads.xml
@@ -9,10 +9,11 @@
   available.
  -->
 <list>
-  <os_id>http://redhat.com/rhel/7.5</os_id>
-  <os_id>http://fedoraproject.org/fedora/28</os_id>
-  <os_id>http://fedoraproject.org/silverblue/28</os_id>
-  <os_id>http://ubuntu.com/ubuntu/18.04</os_id>
+  <os_id>http://redhat.com/rhel/7.6</os_id>
+  <os_id>http://redhat.com/rhel/8.0</os_id>
+  <os_id>http://fedoraproject.org/fedora/29</os_id>
+  <os_id>http://fedoraproject.org/silverblue/29</os_id>
+  <os_id>http://ubuntu.com/ubuntu/18.10</os_id>
   <os_id>http://opensuse.org/opensuse/15.0</os_id>
   <os_id>http://debian.org/debian/9</os_id>
 </list>
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 6868122e..3938e92e 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -277,6 +277,7 @@ private void on_notify_estimated_load_progress () {
     private Gtk.ListBox media_vbox;
     private Gtk.ListBox downloads_vbox;
     private Osinfo.Os rhel_os;
+    private bool is_rhel8 = false;
     private GLib.ListStore downloads_model;
 
     private Cancellable? rhel_cancellable;
@@ -528,6 +529,8 @@ private void on_download_an_os_button_clicked () {
         window.wizard_window.show_downloads_page (media_manager.os_db, (entry) => {
             // Handle custom downloads
             if (entry.os.id.has_prefix ("http://redhat.com/rhel/";)) {
+                is_rhel8 = (entry.os.id == "http://redhat.com/rhel/8.0";);
+
                 on_install_rhel_button_clicked ();
 
                 return;
@@ -556,8 +559,17 @@ private void on_install_rhel_button_clicked () {
 
         var user_agent = get_user_agent ();
         var user_agent_escaped = GLib.Uri.escape_string (user_agent, null, false);
+
+        string rhel_version = "";
+        string rhel_variant = "";
+        if (is_rhel8) {
+            rhel_version = "8";
+            rhel_variant = "&description=DVD+iso";
+        }
+
         var authentication_uri = "https://developers.redhat.com/download-manager/rest/featured/file/rhel"; +
-                                 "?tag=" + user_agent_escaped;
+                                 rhel_version +
+                                 "?tag=" + user_agent_escaped + rhel_variant;
 
         debug ("RHEL ISO authentication URI: %s", authentication_uri);
 
@@ -573,7 +585,9 @@ private bool on_rhel_web_view_decide_policy (WebKit.WebView web_view,
         var action = (decision as WebKit.NavigationPolicyDecision).get_navigation_action ();
         var request = action.get_request ();
         var request_uri = request.get_uri ();
-        if (!request_uri.has_prefix ("https://developers.redhat.com/products/rhel";))
+
+        if (!request_uri.has_prefix ("https://developers.redhat.com/products/rhel";) &&
+            !request_uri.has_prefix ("https://access.cdn.redhat.com";))
             return false;
 
         var soup_request_uri = new Soup.URI (request_uri);
@@ -582,7 +596,8 @@ private bool on_rhel_web_view_decide_policy (WebKit.WebView web_view,
             return false;
 
         var key_value_pairs = Soup.Form.decode (query);
-        var download_uri = key_value_pairs.lookup ("tcDownloadURL");
+
+        var download_uri = is_rhel8 ? request_uri : key_value_pairs.lookup ("tcDownloadURL");
         if (download_uri == null)
             return false;
 
@@ -598,7 +613,7 @@ private bool on_rhel_web_view_decide_policy (WebKit.WebView web_view,
         return_val_if_fail (download_path.length > 0, false);
 
         if (!download_path.has_suffix (".iso")) {
-            download_path = "/rhel.iso";
+            download_path = is_rhel8 ? "/rhel8.iso" : "/rhel.iso";
         }
 
         filename = GLib.Path.get_basename (download_path);


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