From 55ad7871bd993ae5525ca13a82b585470cf32534 Mon Sep 17 00:00:00 2001 From: wangqiang Date: Thu, 6 Jun 2024 11:17:24 +0800 Subject: [PATCH] Add build require gettext and fix test case test_save_as_mofile (cherry picked from commit fa75feb119ad7e0f75a0047907278444c2a9124c) --- ...dont-convert-the-messages-to-UTF-8-encoding.patch | 12 ++++++++++++ python-polib.spec | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 msgfmt-dont-convert-the-messages-to-UTF-8-encoding.patch diff --git a/msgfmt-dont-convert-the-messages-to-UTF-8-encoding.patch b/msgfmt-dont-convert-the-messages-to-UTF-8-encoding.patch new file mode 100644 index 0000000..f09385a --- /dev/null +++ b/msgfmt-dont-convert-the-messages-to-UTF-8-encoding.patch @@ -0,0 +1,12 @@ +diff -Nur a/tests/tests.py b/tests/tests.py +--- a/tests/tests.py 2023-02-24 01:02:41.000000000 +0800 ++++ b/tests/tests.py 2024-06-06 11:09:59.961135920 +0800 +@@ -643,7 +643,7 @@ + os.close(fd) + po = polib.pofile(reffile, autodetect_encoding=False, encoding=encoding) + po.save_as_mofile(tmpfile1) +- subprocess.call([msgfmt, '--no-hash', '-o', tmpfile2, reffile]) ++ subprocess.call([msgfmt, '--no-convert', '--no-hash', '-o', tmpfile2, reffile]) + try: + f = open(tmpfile1, 'rb') + s1 = f.read() diff --git a/python-polib.spec b/python-polib.spec index 48ae1e1..1cd2a7d 100644 --- a/python-polib.spec +++ b/python-polib.spec @@ -1,12 +1,13 @@ Name: python-polib Version: 1.2.0 -Release: 1 +Release: 2 Summary: A library to manipulate gettext files (po and mo files) License: MIT URL: https://pypi.org/project/polib/ Source0: https://pypi.python.org/packages/source/p/polib/polib-%{version}.tar.gz +Patch0: msgfmt-dont-convert-the-messages-to-UTF-8-encoding.patch -BuildRequires: python3-devel +BuildRequires: python3-devel gettext BuildArch: noarch %description @@ -42,6 +43,9 @@ rm -rf polib.egg-info %{python3_sitelib}/* %changelog +* Thu Jun 6 2024 wangqiang - 1.2.0-2 +- Add build require gettext, and fix test case test_save_as_mofile + * Tue Aug 22 2023 wulei - 1.2.0-1 - Update to 1.2.0