[gnome-software: 1/2] gs-appstream: Warn if a font element is empty in some appstream




commit fe817d528b47d7372d5c15af23a9ef7bfc72633d
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Mar 26 22:50:57 2021 +0000

    gs-appstream: Warn if a font element is empty in some appstream
    
    The `org.fedoraproject.material-icons-fonts` component seems to have the
    following in its appstream:
    ```
      <provides>
        <font></font>
        <font>Material Icons</font>
      </provides>
    ```
    
    The first `<font>` was causing a critical warning. Explicitly handle
    that and downgrade it to a warning.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 plugins/core/gs-appstream.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 22fed1154..e7b22f299 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -414,9 +414,10 @@ gs_appstream_refine_add_provides (GsApp *app, XbNode *component, GError **error)
                        }
                }
 
-               if (kind == AS_PROVIDED_KIND_UNKNOWN) {
+               if (kind == AS_PROVIDED_KIND_UNKNOWN ||
+                   xb_node_get_text (provide) == NULL) {
                        /* give up */
-                       g_warning ("ignoring unknown provided item type: %s", element_name);
+                       g_warning ("ignoring unknown or empty provided item type: %s", element_name);
                        continue;
                }
 


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