From patchwork Sat Aug 26 08:57:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 22362 Received: (qmail 49725 invoked by alias); 26 Aug 2017 08:58:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 49711 invoked by uid 89); 26 Aug 2017 08:58:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:120, H*MI:6530, n X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH] intl/tst-gettext: fix failure with newest msgfmt Date: Sat, 26 Aug 2017 10:57:56 +0200 Message-Id: <20170826085756.6530-1-aurelien@aurel32.net> Since upstream gettext commit d13f165b83 (msgfmt: Remove POT-Creation-Date field from the header in the output.), msgfmt does not copy the POT-Creation-Date field in the header entry from the po file to the mo file anymore. This breaks the assumption that we can test gettext by comparing each message in the po files with the corresponding string return by gettext. This makes the intl/tst-gettext to fail. While it would have been possible to modify the po2test.awk script to also strip the line POT-Creation-Date field when creating the msgs.h file, it breaks tst-catgets which also uses it. Instead create a tst-gettext-de.po file from de.po by removing the POT-Creation-Date line. Another alternative would be to use a static tst-gettext-de.po file, but I guess the reason for using de.po is to also catch issues caused by newly added strings. Changelog: [BZ #21508] * catgets/Makefile ($(objpfx)de.msg): Depend on $(common-objpfx)intl/tst-gettext-de.po instead of $(..)po/de.po. * intl/Makefile ($(objpfx)tst-gettext-de.po): Generate intl/tst-gettext-de.po from po/de.po by removing the POT-Creation-Date line. ($(objpfx)msgs.h): Depend on $(objpfx)tst-gettext-de.po instead of ../po/de.po. * intl/tst-gettext.sh: Use ${objpfx}tst-gettext-de.po instead of ../po/de.po. --- ChangeLog | 13 +++++++++++++ catgets/Makefile | 2 +- intl/Makefile | 6 +++++- intl/tst-gettext.sh | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc1cf94dc3..2afa40d1b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2017-08-26 Aurelien Jarno + + [BZ #21508] + * catgets/Makefile ($(objpfx)de.msg): Depend on + $(common-objpfx)intl/tst-gettext-de.po instead of $(..)po/de.po. + * intl/Makefile ($(objpfx)tst-gettext-de.po): Generate + intl/tst-gettext-de.po from po/de.po by removing the + POT-Creation-Date line. + ($(objpfx)msgs.h): Depend on $(objpfx)tst-gettext-de.po instead of + ../po/de.po. + * intl/tst-gettext.sh: Use ${objpfx}tst-gettext-de.po instead of + ../po/de.po. + 2017-08-25 H.J. Lu * sysdeps/x86/cpu-features.h [__ASSEMBLER__] diff --git a/catgets/Makefile b/catgets/Makefile index 39aab67c14..a87172ef5e 100644 --- a/catgets/Makefile +++ b/catgets/Makefile @@ -78,7 +78,7 @@ $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat # Generate a non-simple input file. -$(objpfx)de.msg: xopen-msg.awk $(..)po/de.po +$(objpfx)de.msg: xopen-msg.awk $(common-objpfx)intl/tst-gettext-de.po LC_ALL=C $(AWK) -f $^ $< > $@ $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \ diff --git a/intl/Makefile b/intl/Makefile index c8bec9b138..752aa9f5f5 100644 --- a/intl/Makefile +++ b/intl/Makefile @@ -120,7 +120,11 @@ $(objpfx)tst-gettext6.out: $(gen-locales) $(objpfx)tst-translit.out: $(gen-locales) endif -$(objpfx)msgs.h: po2test.awk ../po/de.po +$(objpfx)tst-gettext-de.po: ../po/de.po + $(make-target-directory) + LC_ALL=C $(AWK) '!/^"POT-Creation-Date: [0-9-]+ [0-9:+-]+\\n"$$/' $^ > $@ + +$(objpfx)msgs.h: po2test.awk $(objpfx)tst-gettext-de.po $(make-target-directory) LC_ALL=C $(AWK) -f $^ > $@ diff --git a/intl/tst-gettext.sh b/intl/tst-gettext.sh index 5c4775b817..be7ea3a399 100755 --- a/intl/tst-gettext.sh +++ b/intl/tst-gettext.sh @@ -42,9 +42,9 @@ mkdir -p ${objpfx}domaindir/existing-locale/LC_MESSAGES mkdir -p ${objpfx}domaindir/existing-locale/LC_TIME # Populate them. msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \ - -f ../po/de.po + -f ${objpfx}tst-gettext-de.po msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \ - -f ../po/de.po + -f ${objpfx}tst-gettext-de.po # Now run the test. ${test_program_prefix_before_env} \