[gnome-software] Ignore multiple pkgname tags in AppStream metadata



commit 16a8e9744678500049f6a242abf4d527e380edb7
Author: Richard Hughes <richard hughsie com>
Date:   Wed Oct 23 08:43:12 2013 +0100

    Ignore multiple pkgname tags in AppStream metadata
    
    This is a spec extension that will be used by font add-ons soon.

 src/plugins/appstream-cache.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/appstream-cache.c b/src/plugins/appstream-cache.c
index 6e4924e..b7e9f53 100644
--- a/src/plugins/appstream-cache.c
+++ b/src/plugins/appstream-cache.c
@@ -630,14 +630,19 @@ appstream_cache_text_cb (GMarkupParseContext *context,
                appstream_app_set_id (helper->item_temp, text, text_len);
                break;
        case APPSTREAM_TAG_PKGNAME:
-               if (helper->item_temp == NULL ||
-                   appstream_app_get_pkgname (helper->item_temp) != NULL) {
+               if (helper->item_temp == NULL) {
                        g_set_error_literal (error,
                                             APPSTREAM_CACHE_ERROR,
                                             APPSTREAM_CACHE_ERROR_FAILED,
                                             "item_temp pkgname invalid");
                        return;
                }
+               if (appstream_app_get_pkgname (helper->item_temp) != NULL) {
+                       g_debug ("multiple pkgname's for %s, ignoring %s",
+                                appstream_app_get_id (helper->item_temp),
+                                text);
+                       return;
+               }
                appstream_app_set_pkgname (helper->item_temp, text, text_len);
                break;
        case APPSTREAM_TAG_NAME:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]