diff --git a/SOURCES/gnome-boxes-filter-supported-arches.patch b/SOURCES/gnome-boxes-filter-supported-arches.patch new file mode 100644 index 0000000..c78d508 --- /dev/null +++ b/SOURCES/gnome-boxes-filter-supported-arches.patch @@ -0,0 +1,82 @@ +From 4de5a560474d4e5a9e4084f3fa47a18426c2217a Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Tue, 21 Jan 2020 11:44:14 +0100 +Subject: [PATCH] media-manager: Filter architectures only for known medias + +https://bugzilla.redhat.com/show_bug.cgi?id=1793413 + +os-database: Only offer supported arches for download + +app-window: Fix build with new Vala +--- + src/app-window.vala | 2 +- + src/installed-media.vala | 2 +- + src/media-manager.vala | 11 ++++++++++- + src/os-database.vala | 3 +++ + 4 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/src/app-window.vala b/src/app-window.vala +index ebe7007a..7e951945 100644 +--- a/src/app-window.vala ++++ b/src/app-window.vala +@@ -422,7 +422,7 @@ public bool on_key_pressed (Widget widget, Gdk.EventKey event) { + + return true; + } else if (event.keyval == Gdk.Key.A && +- (event.state & default_modifiers) == Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK) { ++ (event.state & default_modifiers) == (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) { + foreach_view ((view) => { view.unselect_all (); }); + + return true; +diff --git a/src/installed-media.vala b/src/installed-media.vala +index 09ceffdf..e60f3508 100644 +--- a/src/installed-media.vala ++++ b/src/installed-media.vala +@@ -12,7 +12,7 @@ + ".vpc", ".vpc.gz", + ".cloop", ".cloop.gz" }; + public const string[] supported_architectures = { +- "i686", "i586", "i486", "i386" ++ "i686", "i586", "i486", "i386", "x86_64", "amd64" + }; + private static Regex date_regex = /20[0-9]{6,6}/; + +diff --git a/src/media-manager.vala b/src/media-manager.vala +index 427ce874..f3651d4b 100644 +--- a/src/media-manager.vala ++++ b/src/media-manager.vala +@@ -150,7 +150,16 @@ else if (VMConfigurator.is_libvirt_cloning_config (config)) + continue; + } + +- list.insert_sorted (media, compare_media_by_vendor); ++ if (os_id != null) { ++ var os = yield os_db.get_os_by_id (os_id); ++ var os_media = os_db.get_media_by_id (os, media_id); ++ ++ if (os_media == null || !(os_media.architecture in InstalledMedia.supported_architectures)) { ++ continue; ++ } ++ } ++ ++ list.insert_sorted (media, compare_media_by_vendor); + } catch (GLib.Error error) { + warning ("Failed to use ISO '%s': %s", path, error.message); + } +diff --git a/src/os-database.vala b/src/os-database.vala +index d636cae2..26c0a500 100644 +--- a/src/os-database.vala ++++ b/src/os-database.vala +@@ -124,6 +124,9 @@ public async Os get_os_by_id (string id) throws OSDatabaseError { + if (media.url == null) + continue; + ++ if (!(media.architecture in InstalledMedia.supported_architectures)) ++ continue; ++ + var eol = (os as Product).get_eol_date (); + if (eol == null || now.compare (eol) > 1) + after_list.append (media); +-- +2.17.2 + diff --git a/SOURCES/gnome-boxes-offer-only-supported-arches.patch b/SOURCES/gnome-boxes-offer-only-supported-arches.patch deleted file mode 100644 index a178faa..0000000 --- a/SOURCES/gnome-boxes-offer-only-supported-arches.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 788d5bb418abe88727d33f2b21d56f4ed671b927 Mon Sep 17 00:00:00 2001 -From: Felipe Borges -Date: Thu, 15 Aug 2019 13:11:45 +0200 -Subject: [PATCH] offer-only-supported-arches - ---- - src/installed-media.vala | 2 +- - src/media-manager.vala | 6 +++++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/installed-media.vala b/src/installed-media.vala -index 09ceffdf..e60f3508 100644 ---- a/src/installed-media.vala -+++ b/src/installed-media.vala -@@ -12,7 +12,7 @@ - ".vpc", ".vpc.gz", - ".cloop", ".cloop.gz" }; - public const string[] supported_architectures = { -- "i686", "i586", "i486", "i386" -+ "i686", "i586", "i486", "i386", "x86_64", "amd64" - }; - private static Regex date_regex = /20[0-9]{6,6}/; - -diff --git a/src/media-manager.vala b/src/media-manager.vala -index 427ce874..dc7cc997 100644 ---- a/src/media-manager.vala -+++ b/src/media-manager.vala -@@ -150,7 +150,11 @@ else if (VMConfigurator.is_libvirt_cloning_config (config)) - continue; - } - -- list.insert_sorted (media, compare_media_by_vendor); -+ var os = yield os_db.get_os_by_id (os_id); -+ var os_media = os_db.get_media_by_id (os, media_id); -+ -+ if (os_media.architecture in InstalledMedia.supported_architectures) -+ list.insert_sorted (media, compare_media_by_vendor); - } catch (GLib.Error error) { - warning ("Failed to use ISO '%s': %s", path, error.message); - } --- -2.21.0 - diff --git a/SPECS/gnome-boxes.spec b/SPECS/gnome-boxes.spec index 2e9afd1..b5745bb 100644 --- a/SPECS/gnome-boxes.spec +++ b/SPECS/gnome-boxes.spec @@ -31,7 +31,7 @@ ExclusiveArch: x86_64 Name: gnome-boxes Version: 3.28.5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A simple GNOME 3 application to access remote or virtual systems License: LGPLv2+ @@ -51,7 +51,8 @@ Patch2: gnome-boxes-hardcode-recommended-oses.patch Patch3: gnome-boxes-update-rhel-logo.patch # https://bugzilla.redhat.com/1739897 -Patch4: gnome-boxes-offer-only-supported-arches.patch +# https://bugzilla.redhat.com/1793413 +Patch4: gnome-boxes-filter-supported-arches.patch BuildRequires: gettext >= 0.19.8 BuildRequires: meson @@ -162,6 +163,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Boxes.deskt %{_datadir}/metainfo/org.gnome.Boxes.appdata.xml %changelog +* Tue Jan 21 2020 Felipe Borges - 3.28.5-8 +- Present undetected OSes +- Related: #1793413 + * Thu Aug 15 2019 Felipe Borges - 3.28.5-7 - Bump the release to 3.28.5-7 - Related: #1739897