[gnome-software/wip/hughsie/unique_id] f
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/unique_id] f
- Date: Fri, 29 Jul 2016 21:14:41 +0000 (UTC)
commit c0aa5d16d8308107db46f73148ebb050d9433cc4
Author: Richard Hughes <richard hughsie com>
Date: Fri Jul 29 22:04:11 2016 +0100
f
src/plugins/gs-plugin-limba.c | 8 ++++++++
src/plugins/gs-plugin-snap.c | 9 +++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-limba.c b/src/plugins/gs-plugin-limba.c
index 246d9cc..94124ba 100644
--- a/src/plugins/gs-plugin-limba.c
+++ b/src/plugins/gs-plugin-limba.c
@@ -282,6 +282,8 @@ gs_plugin_app_from_pki (LiPkgInfo *pki)
{
const gchar *cptkind_str;
GsApp *app;
+ g_autoptr(AsAppRef) app_ref = NULL;
+ g_autofree gchar *unique_id = NULL;
cptkind_str = li_pkg_info_get_component_kind (pki);
if ((cptkind_str != NULL) && (g_strcmp0 (cptkind_str, "desktop") == 0)) {
@@ -297,6 +299,12 @@ gs_plugin_app_from_pki (LiPkgInfo *pki)
gs_app_set_kind (app, AS_APP_KIND_GENERIC);
}
+ /* create a unique ID for deduplication, TODO: scope?, branch?, arch? */
+ app_ref = as_app_ref_new (id);
+ as_app_ref_set_system (app_ref, "limba");
+ unique_id = as_app_ref_to_string (app_ref);
+
+ gs_app_set_unique_id (app, unique_id);
gs_app_set_management_plugin (app, "limba");
gs_app_set_state (app, AS_APP_STATE_UPDATABLE_LIVE);
gs_app_set_name (app,
diff --git a/src/plugins/gs-plugin-snap.c b/src/plugins/gs-plugin-snap.c
index 0d6cb7a..b171673 100644
--- a/src/plugins/gs-plugin-snap.c
+++ b/src/plugins/gs-plugin-snap.c
@@ -327,6 +327,8 @@ get_apps (GsPlugin *plugin,
for (l = snaps; l != NULL; l = l->next) {
JsonObject *package = json_node_get_object (l->data);
g_autoptr(GsApp) app = NULL;
+ g_autoptr(AsAppRef) app_ref = NULL;
+ g_autofree gchar *unique_id = NULL;
const gchar *id;
id = json_object_get_string_member (package, "name");
@@ -334,7 +336,14 @@ get_apps (GsPlugin *plugin,
if (filter_func != NULL && !filter_func (id, package, user_data))
continue;
+ /* create a unique ID for deduplication, TODO: branch?, arch? */
+ app_ref = as_app_ref_new (id);
+ as_app_ref_set_scope (app_ref, "system");
+ as_app_ref_set_system (app_ref, "snap");
+ unique_id = as_app_ref_to_string (app_ref);
+
app = gs_app_new (id);
+ gs_app_set_unique_id (app, unique_id);
gs_app_set_management_plugin (app, "snap");
gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
gs_app_add_quirk (app, AS_APP_QUIRK_NOT_REVIEWABLE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]