summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/gettext
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-12-31 19:47:59 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-02 16:39:13 +0000
commitad803a3c7627b57dd3dd1654823582f17f13ceaf (patch)
tree9e0a7ba42f1e33c67d3334fb94c6ae09090c4d34 /meta/recipes-core/gettext
parentf622fb54bef2c59de7bc2c2851ea39fd1b9b8937 (diff)
downloadpoky-ad803a3c7627b57dd3dd1654823582f17f13ceaf.tar.gz
gettext: Backport patch to fix po files without translations
(From OE-Core rev: cf5f46e6435a577170d4c0267dc41b62ef1caab0) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/gettext')
-rw-r--r--meta/recipes-core/gettext/gettext-0.20.1/0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch87
-rw-r--r--meta/recipes-core/gettext/gettext_0.20.1.bb1
2 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-core/gettext/gettext-0.20.1/0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch b/meta/recipes-core/gettext/gettext-0.20.1/0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch
new file mode 100644
index 0000000000..2245889386
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.20.1/0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch
@@ -0,0 +1,87 @@
1From 75e315fdec82d1a17ebcd9e0712d109323578d68 Mon Sep 17 00:00:00 2001
2From: Bruno Haible <bruno@clisp.org>
3Date: Sun, 19 May 2019 11:10:06 +0200
4Subject: [PATCH] msgmerge: Fix behaviour of --for-msgfmt on PO files with no
5 translations.
6
7msgmerge: Fix behaviour of --for-msgfmt on PO files with no translations.
8
9Reported by Don Lawrence <dlawrence@iecok.com>
10in <https://lists.freedesktop.org/archives/p11-glue/2019-May/000700.html>
11via Daiki Ueno
12in <https://lists.gnu.org/archive/html/bug-gettext/2019-05/msg00124.html>.
13
14* gettext-tools/src/msgmerge.c (main): Treat force_po like true if for_msgfmt
15is true.
16* gettext-tools/tests/msgmerge-26: Add test of PO file with no translations.
17
18Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=2336451ed68d91ff4b5ae1acbc1eca30e47a86a9]
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 gettext-tools/src/msgmerge.c | 4 ++--
22 gettext-tools/tests/msgmerge-26 | 36 ++++++++++++++++++++++++++++++---
23 2 files changed, 35 insertions(+), 5 deletions(-)
24
25diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c
26index cd762c0..92c9b7a 100644
27--- a/gettext-tools/src/msgmerge.c
28+++ b/gettext-tools/src/msgmerge.c
29@@ -520,8 +520,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\
30 else
31 {
32 /* Write the merged message list out. */
33- msgdomain_list_print (result, output_file, output_syntax, force_po,
34- false);
35+ msgdomain_list_print (result, output_file, output_syntax,
36+ for_msgfmt || force_po, false);
37 }
38
39 exit (EXIT_SUCCESS);
40diff --git a/gettext-tools/tests/msgmerge-26 b/gettext-tools/tests/msgmerge-26
41index cd3862e..b86f7a0 100755
42--- a/gettext-tools/tests/msgmerge-26
43+++ b/gettext-tools/tests/msgmerge-26
44@@ -73,7 +73,37 @@ msgstr "Papaya"
45 EOF
46
47 : ${DIFF=diff}
48-${DIFF} mm-test26.ok mm-test26.out
49-result=$?
50+${DIFF} mm-test26.ok mm-test26.out || Exit 1
51
52-exit $result
53+# Test with a PO file that has no translated messages.
54+
55+cat <<\EOF > mm-test26a.in1
56+msgid ""
57+msgstr ""
58+"Content-Type: text/plain; charset=UTF-8\n"
59+
60+msgid "Hello world"
61+msgstr "Hallo Welt"
62+EOF
63+
64+cat <<\EOF > mm-test26a.in2
65+msgid ""
66+msgstr ""
67+"Content-Type: text/plain; charset=ASCII\n"
68+
69+msgid "Hello, world!"
70+msgstr ""
71+EOF
72+
73+: ${MSGMERGE=msgmerge}
74+${MSGMERGE} --for-msgfmt -o mm-test26a.tmp mm-test26a.in1 mm-test26a.in2 \
75+ || Exit 1
76+LC_ALL=C tr -d '\r' < mm-test26a.tmp > mm-test26a.out || Exit 1
77+
78+cat <<\EOF > mm-test26a.ok
79+msgid ""
80+msgstr "Content-Type: text/plain; charset=UTF-8\n"
81+EOF
82+
83+: ${DIFF=diff}
84+${DIFF} mm-test26a.ok mm-test26a.out || Exit 1
85--
862.24.1
87
diff --git a/meta/recipes-core/gettext/gettext_0.20.1.bb b/meta/recipes-core/gettext/gettext_0.20.1.bb
index a6fc219568..ca155fe8bf 100644
--- a/meta/recipes-core/gettext/gettext_0.20.1.bb
+++ b/meta/recipes-core/gettext/gettext_0.20.1.bb
@@ -23,6 +23,7 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
23 file://use-pkgconfig.patch \ 23 file://use-pkgconfig.patch \
24 file://run-ptest \ 24 file://run-ptest \
25 file://serial-tests-config.patch \ 25 file://serial-tests-config.patch \
26 file://0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch \
26 " 27 "
27 28
28SRC_URI[md5sum] = "bb5b0c0caa028105f3ca1905ddc306e2" 29SRC_URI[md5sum] = "bb5b0c0caa028105f3ca1905ddc306e2"