Merge pull request #954 from IdrisKalp/master

xz & libxml2 & gettext
This commit is contained in:
Idris Kalp
2019-12-11 02:38:33 +03:00
committed by GitHub
4 changed files with 111 additions and 7 deletions
@@ -0,0 +1,83 @@
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
--- a/gettext-tools/src/msgmerge.c
+++ b/gettext-tools/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
--- a/gettext-tools/tests/msgmerge-26
+++ b/gettext-tools/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
fix-empty-po.patch
+12 -2
View File
@@ -13,7 +13,7 @@
<IsA>library</IsA>
<Summary>GNU libraries and utilities for producing multi-lingual messages</Summary>
<Description>The GNU gettext package provides a set of tools and documentation for producing multi-lingual messages in programs. Tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs, a runtime library which supports the retrieval of translated messages, and stand-alone programs for handling the translatable and the already translated strings. Gettext provides an easy to use library and tools for creating, using, and modifying natural language catalogs and is a powerful and simple method for internationalizing programs.</Description>
<Archive sha1sum="b5d24ba2958c91fc5cc0058165837c99a0f58784" type="targz">http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.8.1.tar.gz</Archive>
<Archive sha1sum="2aa01db95b064d7f5d1a46de34a2cc6a57eadf36" type="targz">http://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz</Archive>
<BuildDependencies>
<Dependency>acl-devel</Dependency>
<Dependency>glib2-devel</Dependency>
@@ -21,6 +21,9 @@
<Dependency>libunistring-devel</Dependency>
<Dependency>libxml2-devel</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">fix-empty-po.patch</Patch>
</Patches>
</Source>
<Package>
@@ -48,7 +51,7 @@
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share/gettext-0.19.8</Path>
<Path fileType="data">/usr/share/gettext-0.20</Path>
<Path fileType="data">/usr/share/gettext</Path>
<Path fileType="localedata">/usr/share/locale</Path>
<Path fileType="info">/usr/share/info</Path>
@@ -73,6 +76,13 @@
</Package>
<History>
<Update release="5">
<Date>2019-09-30</Date>
<Version>0.20.1</Version>
<Comment>Version bump</Comment>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
<Update release="4">
<Date>2018-07-20</Date>
<Version>0.19.8.1</Version>
+8 -4
View File
@@ -12,16 +12,13 @@
<IsA>library</IsA>
<Summary>Version 2 of the library to manipulate XML files</Summary>
<Description>Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform).</Description>
<Archive sha1sum="66bcefd98a6b7573427cf66f9d3841b59eb5b8c3" type="targz">ftp://xmlsoft.org/libxml2/libxml2-2.9.8.tar.gz</Archive>
<Archive sha1sum="db6592ec9ca9708c4e71bf6bfd907bbb5cd40644" type="targz">ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz</Archive>
<BuildDependencies>
<Dependency>python-devel</Dependency>
<Dependency>xz-devel</Dependency>
<Dependency>zlib-devel</Dependency>
<Dependency>readline-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1">CVE-2014-0191.patch</Patch> -->
</Patches>
</Source>
<Package>
@@ -87,6 +84,13 @@
</Package>
<History>
<Update release="8">
<Date>2019-12-11</Date>
<Version>2.9.10</Version>
<Comment>Version bump</Comment>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
<Update release="7">
<Date>2019-01-24</Date>
<Version>2.9.8</Version>
+8 -1
View File
@@ -15,7 +15,7 @@
<IsA>library</IsA>
<Summary>XZ compression utilities</Summary>
<Description>XZ Utils provide a general purpose data compression library and command line tools. The .xz format supports multiple compression algorithms, which are called "filters" in context of XZ Utils. The primary filter is currently LZMA2.</Description>
<Archive sha1sum="1d3a6910c28d40df0134f4a49e5570e8249120c5" type="tarxz">http://tukaani.org/xz/xz-5.2.4.tar.xz</Archive>
<Archive sha1sum="2a53de10934bcc39cdebba250767529ef92abb8e" type="tarxz">https://tukaani.org/xz/xz-5.3.1alpha.tar.xz</Archive>
</Source>
<Package>
@@ -61,6 +61,13 @@
</Package>
<History>
<Update release="6">
<Date>2019-12.11</Date>
<Version>5.3.1</Version>
<Comment>Version bump</Comment>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
<Update release="5">
<Date>2018-11-28</Date>
<Version>5.2.4</Version>