summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-04-23 15:06:54 +0100
committerRichard Hughes <richard@hughsie.com>2014-04-23 15:43:18 +0100
commit9f6c6e6146bc6b6b10ca79a0f73249b9c63d0f81 (patch)
tree7d665f4d461c81297f578100309f7b0e384db889
parentba2da8a9d4e4e0b06597ba26355101273655571b (diff)
downloadappstream-glib-9f6c6e6146bc6b6b10ca79a0f73249b9c63d0f81.tar.gz
When adding a duplicate AppStream application merge the entries
-rw-r--r--libappstream-glib/as-store.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index b5a0caa..b7dbe72 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -311,6 +311,15 @@ as_store_add_app (AsStore *store, AsApp *app)
return;
}
+ /* same priority */
+ if (as_app_get_priority (item) ==
+ as_app_get_priority (app)) {
+ g_debug ("merging duplicate AppStream entries: %s", id);
+ as_app_subsume_full (item, app,
+ AS_APP_SUBSUME_FLAG_BOTH_WAYS);
+ return;
+ }
+
/* this new item has a higher priority than the one we've
* previously stored */
g_debug ("replacing duplicate AppStream entry: %s", id);