Fix the last commit

This commit is contained in:
Daiki Ueno 2014-06-02 19:14:25 +09:00
parent 991bf5f363
commit f59f2fe383

View File

@ -1,7 +1,7 @@
From 806a05b0e8b2020cdaaa08b535bceb6a0bce6764 Mon Sep 17 00:00:00 2001
From 953c7242b96f150c6f4b67d15603c79695e3f4f6 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Mon, 2 Jun 2014 18:04:41 +0900
Subject: [PATCH] msgl-check: Ignore non-fatal errors in check_header_entry
Subject: [PATCH] msgl-check: Treat missing header errors as warnings
Problem reported by Richard Hughes at
<https://lists.fedoraproject.org/pipermail/devel/2014-June/199539.html>.
@ -12,18 +12,23 @@ for the moment and wait for one or two release cycles.
* gettext-tools/src/msgl-check.c (check_header_entry): Report missing
required headers as warning, instead of error.
---
gettext-tools/src/msgl-check.c | 11 +++++++++--
gettext-tools/src/msgl-check.c | 16 ++++++++++++++--
gettext-tools/tests/msgfmt-10 | 6 +++---
2 files changed, 12 insertions(+), 5 deletions(-)
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/gettext-tools/src/msgl-check.c b/gettext-tools/src/msgl-check.c
index ee68ae4..a745cb0 100644
index ee68ae4..64a68f6 100644
--- a/gettext-tools/src/msgl-check.c
+++ b/gettext-tools/src/msgl-check.c
@@ -777,8 +777,13 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
@@ -777,8 +777,18 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
for (cnt = 0; cnt < nfields; ++cnt)
{
+ /* 0.19 change: It would better report error if a required
+ header field is missing. However, traditionally we didn't
+ treat it as error. Let's wait for one or two cycles until we
+ can assume the required header fields are always
+ available in practical PO files. */
+#if 0
int severity =
(cnt < nrequiredfields ? PO_SEVERITY_ERROR : PO_SEVERITY_WARNING);
@ -34,7 +39,7 @@ index ee68ae4..a745cb0 100644
const char *field = required_fields[cnt];
size_t len = strlen (field);
const char *line;
@@ -805,7 +810,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
@@ -805,7 +815,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
field);
po_xerror (severity, mp, NULL, 0, 0, true, msg);
free (msg);
@ -44,7 +49,7 @@ index ee68ae4..a745cb0 100644
}
}
break;
@@ -821,7 +827,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
@@ -821,7 +832,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string)
field);
po_xerror (severity, mp, NULL, 0, 0, true, msg);
free (msg);
@ -55,7 +60,7 @@ index ee68ae4..a745cb0 100644
}
return seen_errors;
diff --git a/gettext-tools/tests/msgfmt-10 b/gettext-tools/tests/msgfmt-10
index 03ee55b..ddc1566 100755
index 03ee55b..d747cf8 100755
--- a/gettext-tools/tests/msgfmt-10
+++ b/gettext-tools/tests/msgfmt-10
@@ -48,7 +48,6 @@ msgstr ""
@ -75,7 +80,7 @@ index 03ee55b..ddc1566 100755
-mf-test10.po2:20: number of format specifications in 'msgid_plural' and 'msgstr[1]' does not match
-msgfmt: found 2 fatal errors
+mf-test10.po2:19: number of format specifications in 'msgid_plural' and 'msgstr[1]' does not match
+msgfmt: found 1 fatal errors
+msgfmt: found 1 fatal error
EOF
: ${DIFF=diff}