diff options
author | Richard Hughes <richard@hughsie.com> | 2014-06-26 15:13:34 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-06-26 15:18:09 +0100 |
commit | 60c3814ee3b7f90d53b7d59a0d13ab2da36a61f8 (patch) | |
tree | eed88e42e1985d46af6440d40294e639e7b76705 /libappstream-glib/as-store.c | |
parent | 0d3ad4d233b2a1c85d3149adc160f9619e4d30e4 (diff) | |
download | appstream-glib-60c3814ee3b7f90d53b7d59a0d13ab2da36a61f8.tar.gz |
trivial: Show the source kinds to allow debugging duplicate entries
Diffstat (limited to 'libappstream-glib/as-store.c')
-rw-r--r-- | libappstream-glib/as-store.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index f408c69..32482c5 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -306,16 +306,34 @@ as_store_add_app (AsStore *store, AsApp *app) if (item != NULL) { /* the previously stored app is higher priority */ + if (as_app_get_source_kind (app) == AS_APP_SOURCE_KIND_APPDATA && + as_app_get_source_kind (item) == AS_APP_SOURCE_KIND_APPSTREAM) { + g_debug ("ignoring AppData entry as AppStream exists: %s", id); + return; + } + if (as_app_get_source_kind (app) == AS_APP_SOURCE_KIND_DESKTOP && + as_app_get_source_kind (item) == AS_APP_SOURCE_KIND_APPSTREAM) { + g_debug ("ignoring desktop entry as AppStream exists: %s", id); + return; + } + + /* the previously stored app is higher priority */ if (as_app_get_priority (item) > as_app_get_priority (app)) { - g_debug ("ignoring duplicate AppStream entry: %s", id); + g_debug ("ignoring duplicate %s:%s entry: %s", + as_app_source_kind_to_string (as_app_get_source_kind (app)), + as_app_source_kind_to_string (as_app_get_source_kind (item)), + id); return; } /* same priority */ if (as_app_get_priority (item) == as_app_get_priority (app)) { - g_debug ("merging duplicate AppStream entries: %s", id); + g_debug ("merging duplicate %s:%s entries: %s", + as_app_source_kind_to_string (as_app_get_source_kind (app)), + as_app_source_kind_to_string (as_app_get_source_kind (item)), + id); as_app_subsume_full (item, app, AS_APP_SUBSUME_FLAG_BOTH_WAYS); return; |