gnome-boxes/SOURCES/gnome-boxes-offer-only-supported-arches.patch
2021-10-08 11:25:07 +00:00

44 lines
1.7 KiB
Diff

From 788d5bb418abe88727d33f2b21d56f4ed671b927 Mon Sep 17 00:00:00 2001
From: Felipe Borges <felipeborges@gnome.org>
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