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



commit 0fee7b1738d92b2401914c5fcf093e4aebb057e7
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 a9a3af0..63e8827 100644
--- a/src/plugins/appstream-cache.c
+++ b/src/plugins/appstream-cache.c
@@ -474,14 +474,19 @@ appstream_cache_text_cb (GMarkupParseContext *context,
                appstream_app_set_id (helper->item_temp, text, text_len);
                break;
        case APPSTREAM_CACHE_SECTION_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_CACHE_SECTION_NAME:


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