diff options
Diffstat (limited to 'libappstream-glib')
-rw-r--r-- | libappstream-glib/as-app-private.h | 2 | ||||
-rw-r--r-- | libappstream-glib/as-app-validate.c | 6 | ||||
-rw-r--r-- | libappstream-glib/as-app.c | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-private.h b/libappstream-glib/as-app-private.h index d5e74d7..eeaec3b 100644 --- a/libappstream-glib/as-app-private.h +++ b/libappstream-glib/as-app-private.h @@ -48,6 +48,7 @@ G_BEGIN_DECLS * @AS_APP_PROBLEM_TRANSLATED_ID: The <id> value was translated * @AS_APP_PROBLEM_TRANSLATED_LICENSE: The <license> value was translated * @AS_APP_PROBLEM_TRANSLATED_PROJECT_GROUP: The <project_group> value was translated + * @AS_APP_PROBLEM_UPDATECONTACT_FALLBACK: The file used <updatecontact> without a space * * The application problems detected when loading. **/ @@ -65,6 +66,7 @@ typedef enum { AS_APP_PROBLEM_TRANSLATED_ID = 1 << 9, AS_APP_PROBLEM_TRANSLATED_LICENSE = 1 << 10, AS_APP_PROBLEM_TRANSLATED_PROJECT_GROUP = 1 << 11, + AS_APP_PROBLEM_UPDATECONTACT_FALLBACK = 1 << 12, /*< private >*/ AS_APP_PROBLEM_LAST } AsAppProblems; diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c index 1f87324..bce8f13 100644 --- a/libappstream-glib/as-app-validate.c +++ b/libappstream-glib/as-app-validate.c @@ -1317,6 +1317,12 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error) AS_PROBLEM_KIND_VALUE_MISSING, "<!-- Copyright [year] [name] --> is not present"); } + if (deprectated_failure && + (problems & AS_APP_PROBLEM_UPDATECONTACT_FALLBACK) > 0) { + ai_app_validate_add (&helper, + AS_PROBLEM_KIND_TAG_INVALID, + "<updatecontact> should be <update_contact>"); + } } /* check for things that have to exist */ diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 812c1b4..996cb33 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -3496,6 +3496,11 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags, /* <update_contact> */ case AS_TAG_UPDATE_CONTACT: + + /* this is the old name */ + if (g_strcmp0 (as_node_get_name (n), "updatecontact") == 0) + priv->problems |= AS_APP_PROBLEM_UPDATECONTACT_FALLBACK; + as_app_set_update_contact (app, as_node_get_data (n)); break; |