summaryrefslogtreecommitdiff
path: root/app/flatpak-builtins-info.c
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2018-02-07 13:34:25 -0800
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 11:08:40 +0000
commitb80191fdcd3df13905c2c900709c81753df501dd (patch)
tree653e751d83ec439a89ed64a468a2f8548d3a774b /app/flatpak-builtins-info.c
parent728bb4d02e723966319981631649b5a4f6822f7e (diff)
downloadflatpak-b80191fdcd3df13905c2c900709c81753df501dd.tar.gz
app: Print a warning if xa.metadata doesn't exist
All flatpaks built using version 0.9.4 or newer should have the xa.metadata field in the commit metadata, so warn if it doesn't exist. This commit changes the info command to print a warning rather than nothing and changes the info-remote command to print a warning rather than error out. Closes: #1351 Approved by: alexlarsson
Diffstat (limited to 'app/flatpak-builtins-info.c')
-rw-r--r--app/flatpak-builtins-info.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/flatpak-builtins-info.c b/app/flatpak-builtins-info.c
index d611a232..2367adaf 100644
--- a/app/flatpak-builtins-info.c
+++ b/app/flatpak-builtins-info.c
@@ -181,6 +181,7 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
const gchar *body = NULL;
g_autofree char *parent = NULL;
const char *latest;
+ const char *xa_metadata = NULL;
const char *collection_id = NULL;
latest = flatpak_dir_read_latest (dir, origin, ref, NULL, NULL, NULL);
@@ -196,6 +197,9 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
formatted_timestamp = format_timestamp (timestamp);
commit_metadata = g_variant_get_child_value (commit_v, 0);
+ g_variant_lookup (commit_metadata, "xa.metadata", "&s", &xa_metadata);
+ if (xa_metadata == NULL)
+ g_printerr (_("Warning: Commit has no flatpak metadata\n"));
#ifdef FLATPAK_ENABLE_P2P
g_variant_lookup (commit_metadata, "ostree.collection-binding", "&s", &collection_id);