[gnome-software] trivial: Do not try to fetch the remote metadata for a .flatpak file
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Do not try to fetch the remote metadata for a .flatpak file
- Date: Thu, 9 Feb 2017 15:03:36 +0000 (UTC)
commit 8bcaf8a679cc1509a4353b6196211989369fa1a3
Author: Richard Hughes <richard hughsie com>
Date: Thu Feb 9 15:01:46 2017 +0000
trivial: Do not try to fetch the remote metadata for a .flatpak file
src/plugins/gs-flatpak.c | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 2756596..18aa37b 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -1708,7 +1708,7 @@ gs_flatpak_fetch_remote_metadata (GsFlatpak *self,
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
- "no origin set for %s",
+ "no origin set when getting metadata for %s",
gs_app_get_unique_id (app));
return NULL;
}
@@ -2197,28 +2197,33 @@ install_runtime_for_app (GsFlatpak *self,
GError **error)
{
GsApp *runtime;
- gsize len;
- const gchar *str;
- g_autoptr(GBytes) data = gs_flatpak_fetch_remote_metadata (self, app,
- cancellable,
- error);
- if (data == NULL) {
- gs_utils_error_add_unique_id (error, app);
- gs_app_set_state_recover (app);
- return FALSE;
- }
+ /* only required for ostree-based flatpak apps */
+ if (g_strcmp0 (gs_app_get_flatpak_file_type (app), "flatpak") != 0) {
+ gsize len;
+ const gchar *str;
+ g_autoptr(GBytes) data = NULL;
+ g_autoptr(GsApp) runtime_new = NULL;
- str = g_bytes_get_data (data, &len);
- runtime = gs_flatpak_create_runtime_from_metadata (self, app, str, len,
- error);
+ data = gs_flatpak_fetch_remote_metadata (self, app, cancellable, error);
+ if (data == NULL) {
+ gs_utils_error_add_unique_id (error, app);
+ gs_app_set_state_recover (app);
+ return FALSE;
+ }
+
+ str = g_bytes_get_data (data, &len);
+ runtime_new = gs_flatpak_create_runtime_from_metadata (self, app,
+ str, len,
+ error);
+ gs_app_set_update_runtime (app, runtime_new);
+ }
/* no runtime required */
+ runtime = gs_app_get_update_runtime (app);
if (runtime == NULL)
return TRUE;
- gs_app_set_update_runtime (app, runtime);
-
/* the runtime could come from a different remote to the app */
if (!gs_refine_item_metadata (self, runtime, cancellable, error)) {
gs_utils_error_add_unique_id (error, runtime);
@@ -2329,7 +2334,7 @@ gs_flatpak_app_install (GsFlatpak *self,
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
- "no origin set for %s",
+ "no origin set for remote %s",
gs_app_get_unique_id (app));
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]