[gnome-boxes/gnome-3-30] wizard-downloads: Add RHEL8 Beta
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-3-30] wizard-downloads: Add RHEL8 Beta
- Date: Fri, 16 Nov 2018 14:47:01 +0000 (UTC)
commit 31525cbd4e1770a99f15c8970decc0a72f4abbc1
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Nov 16 12:52:58 2018 +0100
wizard-downloads: Add RHEL8 Beta
This is a quick fix so we don't loose the timing of the Beta
release.
In 3.32 we won't need these manual updates.
build-aux/flatpak/org.gnome.Boxes.json | 12 ++++++++----
data/osinfo/meson.build | 1 +
data/osinfo/rhel-8.0.xml | 10 ++++++++++
src/wizard-downloads-page.vala | 1 +
src/wizard-source.vala | 31 +++++++++++++++++++++++++------
5 files changed, 45 insertions(+), 10 deletions(-)
---
diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
index 5bbdd87b..f9b0c730 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -329,8 +329,9 @@
"sources" : [
{
"type" : "file",
- "url" : "https://releases.pagure.org/libosinfo/osinfo-db-20181101.tar.xz",
- "sha256" : "a7ede6ea8419290d2e53b4f1d598a1bdd88298be7e08e8226efab9ab6dc13dd9"
+ "url" : "https://releases.pagure.org/libosinfo/osinfo-db-20181116.tar.xz",
+ "sha256" : "e7e7623a621493e94bb13e6ebd456f1e278c77bebf390d3bf8f3dcadb3142d7c"
+
}
]
},
@@ -366,7 +367,10 @@
"name" : "gnome-boxes",
"buildsystem" : "meson",
"config-opts" : [
- "-Dflatpak=true"
+ "-Dflatpak=true",
+ "-Ddistributor_name=gnome-boxes-flathub",
+ "-Ddistributor_version=3.32"
+
],
"sources" : [
{
@@ -378,4 +382,4 @@
]
}
]
-}
\ No newline at end of file
+}
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/src/wizard-downloads-page.vala b/src/wizard-downloads-page.vala
index 5c2d2033..caca4e65 100644
--- a/src/wizard-downloads-page.vala
+++ b/src/wizard-downloads-page.vala
@@ -33,6 +33,7 @@
*/
private string[] recommended_downloads = {
"http://redhat.com/rhel/7.6",
+ "http://redhat.com/rhel/8.0",
"http://fedoraproject.org/fedora/29",
"http://fedoraproject.org/silverblue/29",
"http://ubuntu.com/ubuntu/18.10",
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 889ce886..b153b355 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -314,6 +314,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;
@@ -323,9 +324,13 @@ private void on_notify_estimated_load_progress () {
public string filename { get; set; }
private string[] recommended_downloads = {
- "http://ubuntu.com/ubuntu/16.04",
+ "http://redhat.com/rhel/7.6",
+ "http://redhat.com/rhel/8.0",
+ "http://fedoraproject.org/fedora/29",
+ "http://fedoraproject.org/silverblue/29",
+ "http://ubuntu.com/ubuntu/18.10",
"http://opensuse.org/opensuse/42.3",
- "http://fedoraproject.org/fedora/27",
+ "http://debian.org/debian/9",
};
public bool download_required {
@@ -583,6 +588,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;
@@ -611,8 +618,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);
@@ -628,7 +644,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);
@@ -637,7 +655,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;
@@ -653,7 +672,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]