From 6ed8a98dd921afe3eb42765e49e9f09a46a006bc Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Thu, 2 May 2024 23:40:46 +0200 Subject: [PATCH] Only emit legacy compat tag developer_name for catalog data Resolves: #631 --- src/as-component.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/as-component.c b/src/as-component.c index e7b725bf..fa7d10cf 100644 --- a/src/as-component.c +++ b/src/as-component.c @@ -4967,8 +4967,11 @@ xmlNode * as_component_to_xml_node (AsComponent *cpt, AsContext *ctx, xmlNode *root) { AsComponentPrivate *priv = GET_PRIVATE (cpt); + AsFormatStyle format_style; xmlNode *cnode; + format_style = as_context_get_style (ctx); + /* define component root node properties */ if (root == NULL) cnode = xmlNewNode (NULL, (xmlChar *) "component"); @@ -4990,7 +4993,7 @@ as_component_to_xml_node (AsComponent *cpt, AsContext *ctx, xmlNode *root) as_xml_add_text_prop (cnode, "date_eol", time_str); } - if (as_context_get_style (ctx) == AS_FORMAT_STYLE_CATALOG) { + if (format_style == AS_FORMAT_STYLE_CATALOG) { /* write some propties which only exist in catalog XML */ if (priv->merge_kind != AS_MERGE_KIND_NONE) { as_xml_add_text_prop (cnode, @@ -5020,7 +5023,7 @@ as_component_to_xml_node (AsComponent *cpt, AsContext *ctx, xmlNode *root) as_xml_add_localized_text_node (cnode, "summary", priv->summary); /* order license and project group after name/summary */ - if (as_context_get_style (ctx) == AS_FORMAT_STYLE_METAINFO) + if (format_style == AS_FORMAT_STYLE_METAINFO) as_xml_add_text_node (cnode, "metadata_license", priv->metadata_license); /* project license */ @@ -5036,7 +5039,8 @@ as_component_to_xml_node (AsComponent *cpt, AsContext *ctx, xmlNode *root) if (priv->developer != NULL) { as_developer_to_xml_node (priv->developer, ctx, cnode); - if (as_context_get_format_version (ctx) <= AS_FORMAT_VERSION_V1_0) { + if (format_style == AS_FORMAT_STYLE_CATALOG && + as_context_get_format_version (ctx) <= AS_FORMAT_VERSION_V1_0) { /* Add the deprecated tag for now, for improved backwards compatibility */ as_xml_add_text_node ( cnode,