diff options
author | Richard Hughes <richard@hughsie.com> | 2018-06-27 17:00:26 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2018-06-27 17:00:41 +0100 |
commit | 5bc8d2ff82d25286eea2eb492e1eb10004339412 (patch) | |
tree | fd8838a213aa2e5ed5a94732d37a7c3cb6f92649 | |
parent | 2afcf51f64e8521831e11d11db92422b2a60bbd6 (diff) | |
download | appstream-glib-5bc8d2ff82d25286eea2eb492e1eb10004339412.tar.gz |
Do not require a release transaction when validating in relaxed mode
This allows upstream projects to prepare (and translate) the release data
before know the actual release date.
Fixes: https://github.com/hughsie/appstream-glib/issues/246
-rw-r--r-- | libappstream-glib/as-app-validate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c index f6fa323..628a527 100644 --- a/libappstream-glib/as-app-validate.c +++ b/libappstream-glib/as-app-validate.c @@ -828,10 +828,12 @@ as_app_validate_release (AsApp *app, guint64 timestamp; guint number_para_max = 3; guint number_para_min = 1; + gboolean required_timestamp = TRUE; /* relax the requirements a bit */ if ((helper->flags & AS_APP_VALIDATE_FLAG_RELAX) > 0) { number_para_max = 4; + required_timestamp = FALSE; } /* check version */ @@ -844,7 +846,7 @@ as_app_validate_release (AsApp *app, /* check timestamp */ timestamp = as_release_get_timestamp (release); - if (timestamp == 0) { + if (required_timestamp && timestamp == 0) { ai_app_validate_add (helper, AS_PROBLEM_KIND_ATTRIBUTE_MISSING, "<release> has no timestamp"); |