summaryrefslogtreecommitdiff
path: root/libappstream-glib
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-06-27 17:00:26 +0100
committerRichard Hughes <richard@hughsie.com>2018-06-27 17:00:41 +0100
commit5bc8d2ff82d25286eea2eb492e1eb10004339412 (patch)
treefd8838a213aa2e5ed5a94732d37a7c3cb6f92649 /libappstream-glib
parent2afcf51f64e8521831e11d11db92422b2a60bbd6 (diff)
downloadappstream-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
Diffstat (limited to 'libappstream-glib')
-rw-r--r--libappstream-glib/as-app-validate.c4
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");