summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-07-11 12:21:07 +0100
committerRichard Hughes <richard@hughsie.com>2014-07-11 12:21:39 +0100
commit6ac88cc7a9e89d3fd5a1c0602b7b4ad7ff5e239c (patch)
treefb238fe5cb50c7023c3aceaa5ffcbc5bea2d82c4
parent77be307ac07e003eb0f0e89bec24a26d2b34934c (diff)
downloadappstream-glib-6ac88cc7a9e89d3fd5a1c0602b7b4ad7ff5e239c.tar.gz
Do not parse the license strings when in relaxed validation mode
-rw-r--r--libappstream-glib/as-app-validate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
index 9292393..5d13bb4 100644
--- a/libappstream-glib/as-app-validate.c
+++ b/libappstream-glib/as-app-validate.c
@@ -842,6 +842,7 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error)
gboolean require_translations = FALSE;
gboolean require_url = TRUE;
gboolean require_content_license = TRUE;
+ gboolean validate_license = TRUE;
gboolean ret;
guint length_name_max = 30;
guint length_name_min = 3;
@@ -858,6 +859,7 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error)
length_summary_max = 200;
require_contactdetails = FALSE;
require_content_license = FALSE;
+ validate_license = FALSE;
require_url = FALSE;
number_para_max = 10;
number_para_min = 1;
@@ -940,7 +942,7 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error)
AS_PROBLEM_KIND_TAG_INVALID,
"<metadata_license> is not valid");
}
- } else {
+ } else if (validate_license) {
ret = as_app_validate_license (license, &error_local);
if (!ret) {
g_prefix_error (&error_local,
@@ -967,7 +969,7 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error)
/* project_license */
license = as_app_get_project_license (app);
- if (license != NULL) {
+ if (license != NULL && validate_license) {
ret = as_app_validate_license (license, &error_local);
if (!ret) {
g_prefix_error (&error_local,