[gnome-software/wip/kalev/gnome-3-22: 35/96] trivial: Don't rely on REQUIRE_RELATED to set the runtime properly
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/kalev/gnome-3-22: 35/96] trivial: Don't rely on REQUIRE_RELATED to set the runtime properly
- Date: Tue, 7 Mar 2017 16:26:47 +0000 (UTC)
commit 91ce56492a3b5f48fb66dc02148aa53b75bc95fe
Author: Richard Hughes <richard hughsie com>
Date: Mon Jan 9 17:03:22 2017 +0000
trivial: Don't rely on REQUIRE_RELATED to set the runtime properly
src/gs-cmd.c | 2 ++
src/gs-plugin-loader.c | 4 +++-
src/gs-plugin.h | 2 ++
src/gs-shell-details.c | 2 ++
src/plugins/gs-flatpak.c | 3 ++-
5 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-cmd.c b/src/gs-cmd.c
index 9014417..a6a219d 100644
--- a/src/gs-cmd.c
+++ b/src/gs-cmd.c
@@ -144,6 +144,8 @@ gs_cmd_refine_flag_from_string (const gchar *flag, GError **error)
return GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME;
if (g_strcmp0 (flag, "origin-ui") == 0)
return GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI;
+ if (g_strcmp0 (flag, "runtime") == 0)
+ return GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME;
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 189f281..3a8fefe 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -401,6 +401,8 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME)
flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
+ if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE)
+ flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME;
/* try to adopt each application with a plugin */
gs_plugin_loader_run_adopt (plugin_loader, list);
@@ -522,7 +524,7 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
}
/* also do runtime */
- if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
+ if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME) > 0) {
g_autoptr(GsAppList) list2 = gs_app_list_new ();
for (i = 0; i < gs_app_list_length (list); i++) {
GsApp *runtime;
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 0dfa8e7..c90cecc 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -167,6 +167,7 @@ typedef enum {
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS: Require the needed permissions
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME: Require the origin hostname
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI: Require the origin for UI
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME: Require the runtime
*
* The refine flags.
**/
@@ -196,6 +197,7 @@ typedef enum {
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS (1u << 22)
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME (1u << 23)
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI (1u << 24)
+#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME (1u << 25)
typedef guint64 GsPluginRefineFlags;
/**
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index f10d4fa..83be20f 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1455,6 +1455,7 @@ gs_shell_details_set_local_file (GsShellDetails *self, GFile *file)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS,
self->cancellable,
gs_shell_details_file_to_app_cb,
@@ -1477,6 +1478,7 @@ gs_shell_details_load (GsShellDetails *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS,
self->cancellable,
gs_shell_details_app_refine_cb,
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index cad29cd..98355d0 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -1753,7 +1753,8 @@ gs_flatpak_refine_app (GsFlatpak *self,
}
/* permissions */
- if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS) {
+ if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME ||
+ flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS) {
if (!gs_plugin_refine_item_metadata (self, app,
cancellable, error)) {
g_prefix_error (error, "failed to get permissions: ");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]