diff options
author | Richard Hughes <richard@hughsie.com> | 2016-08-10 14:22:26 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-08-10 14:22:26 +0100 |
commit | 2eb08ca8d57dca6279ce747f351e37f1bbfa2608 (patch) | |
tree | f009eb4af6697f24b33fe6f5b692313371f04d59 | |
parent | 72f5fe62566a81b53789d864750edcad1d5804d7 (diff) | |
download | appstream-glib-2eb08ca8d57dca6279ce747f351e37f1bbfa2608.tar.gz |
trivial: Allow setting the output trusted mode using an environment variable
-rw-r--r-- | libappstream-glib/as-store.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index dbdbd31..c8ef6c2 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -1927,6 +1927,7 @@ as_store_to_xml (AsStore *store, AsNodeToXmlFlags flags) AsNode *node_apps; AsNode *node_root; GString *xml; + gboolean output_trusted = FALSE; guint i; gchar version[6]; g_autofree AsNodeContext *ctx = NULL; @@ -1956,10 +1957,15 @@ as_store_to_xml (AsStore *store, AsNodeToXmlFlags flags) /* sort by ID */ g_ptr_array_sort (priv->array, as_store_apps_sort_cb); + /* output is trusted, so include update_contact */ + if (g_getenv ("APPSTREAM_GLIB_OUTPUT_TRUSTED") != NULL) + output_trusted = TRUE; + /* add applications */ ctx = as_node_context_new (); as_node_context_set_version (ctx, priv->api_version); as_node_context_set_output (ctx, AS_APP_SOURCE_KIND_APPSTREAM); + as_node_context_set_output_trusted (ctx, output_trusted); for (i = 0; i < priv->array->len; i++) { app = g_ptr_array_index (priv->array, i); as_app_node_insert (app, node_apps, ctx); |