Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2019 09:53:20 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r506984 - in head/devel/gettext-tools: . files
Message-ID:  <201907200953.x6K9rK1p020454@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Sat Jul 20 09:53:20 2019
New Revision: 506984
URL: https://svnweb.freebsd.org/changeset/ports/506984

Log:
  Add patch with upstream git commit 2336451ed68d91ff4b5ae1acbc1eca30e47a86a9:
  msgmerge: Fix behaviour of --for-msgfmt on PO files with no translations.
  
  This fixes building libgtop and gcr from git.
  
  PR:		239328
  Submitted by:	Ting-Wei Lan <lantw44@gmail.com>

Added:
  head/devel/gettext-tools/files/patch-git_2336451ed68d91ff   (contents, props changed)
Modified:
  head/devel/gettext-tools/Makefile

Modified: head/devel/gettext-tools/Makefile
==============================================================================
--- head/devel/gettext-tools/Makefile	Sat Jul 20 09:41:32 2019	(r506983)
+++ head/devel/gettext-tools/Makefile	Sat Jul 20 09:53:20 2019	(r506984)
@@ -5,7 +5,7 @@
 # discretion.
 
 PORTNAME=	gettext-tools
-PORTREVISION=	0
+PORTREVISION=	1
 
 COMMENT=	GNU gettext development and translation tools
 

Added: head/devel/gettext-tools/files/patch-git_2336451ed68d91ff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/gettext-tools/files/patch-git_2336451ed68d91ff	Sat Jul 20 09:53:20 2019	(r506984)
@@ -0,0 +1,81 @@
+From 2336451ed68d91ff4b5ae1acbc1eca30e47a86a9 Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Sun, 19 May 2019 13:10:06 +0200
+Subject: [PATCH] msgmerge: Fix behaviour of --for-msgfmt on PO files with no
+ translations.
+
+Reported by Don Lawrence <dlawrence@iecok.com>
+in <https://lists.freedesktop.org/archives/p11-glue/2019-May/000700.html>;
+via Daiki Ueno
+in <https://lists.gnu.org/archive/html/bug-gettext/2019-05/msg00124.html>.
+
+* gettext-tools/src/msgmerge.c (main): Treat force_po like true if for_msgfmt
+is true.
+* gettext-tools/tests/msgmerge-26: Add test of PO file with no translations.
+---
+ gettext-tools/src/msgmerge.c    |  4 ++--
+ gettext-tools/tests/msgmerge-26 | 36 +++++++++++++++++++++++++++++++++---
+ 2 files changed, 35 insertions(+), 5 deletions(-)
+
+diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c
+index cd762c0..92c9b7a 100644
+--- src/msgmerge.c
++++ src/msgmerge.c
+@@ -520,8 +520,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\
+   else
+     {
+       /* Write the merged message list out.  */
+-      msgdomain_list_print (result, output_file, output_syntax, force_po,
+-                            false);
++      msgdomain_list_print (result, output_file, output_syntax,
++                            for_msgfmt || force_po, false);
+     }
+ 
+   exit (EXIT_SUCCESS);
+diff --git a/gettext-tools/tests/msgmerge-26 b/gettext-tools/tests/msgmerge-26
+index cd3862e..b86f7a0 100755
+--- tests/msgmerge-26
++++ tests/msgmerge-26
+@@ -73,7 +73,37 @@ msgstr "Papaya"
+ EOF
+ 
+ : ${DIFF=diff}
+-${DIFF} mm-test26.ok mm-test26.out
+-result=$?
++${DIFF} mm-test26.ok mm-test26.out || Exit 1
+ 
+-exit $result
++# Test with a PO file that has no translated messages.
++
++cat <<\EOF > mm-test26a.in1
++msgid ""
++msgstr ""
++"Content-Type: text/plain; charset=UTF-8\n"
++
++msgid "Hello world"
++msgstr "Hallo Welt"
++EOF
++
++cat <<\EOF > mm-test26a.in2
++msgid ""
++msgstr ""
++"Content-Type: text/plain; charset=ASCII\n"
++
++msgid "Hello, world!"
++msgstr ""
++EOF
++
++: ${MSGMERGE=msgmerge}
++${MSGMERGE} --for-msgfmt -o mm-test26a.tmp mm-test26a.in1 mm-test26a.in2 \
++    || Exit 1
++LC_ALL=C tr -d '\r' < mm-test26a.tmp > mm-test26a.out || Exit 1
++
++cat <<\EOF > mm-test26a.ok
++msgid ""
++msgstr "Content-Type: text/plain; charset=UTF-8\n"
++EOF
++
++: ${DIFF=diff}
++${DIFF} mm-test26a.ok mm-test26a.out || Exit 1
+-- 
+1.9.1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907200953.x6K9rK1p020454>