From: Aurelien Jarno <aurelien@aurel32.net>
To: libc-alpha@sourceware.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: [PATCH] intl/tst-gettext: fix failure with newest msgfmt
Date: Sat, 26 Aug 2017 08:58:00 -0000 [thread overview]
Message-ID: <20170826085756.6530-1-aurelien@aurel32.net> (raw)
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 <aurelien@aurel32.net>
+
+ [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 <hongjiu.lu@intel.com>
* 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} \
--
2.14.1
next reply other threads:[~2017-08-26 8:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-26 8:58 Aurelien Jarno [this message]
2018-01-26 14:40 ` Szabolcs Nagy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170826085756.6530-1-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).