From 913b88e6b4e7ac28999131013f74c46b4e04ba20 Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Thu, 30 Nov 2023 11:48:04 +0800 Subject: [PATCH] fix -o -output parameter is invalid (cherry picked from commit f0890acbca87159deba959fdcf1936dc9307a38d) --- fix-o-output-parameter-is-invalid.patch | 24 ++++++++++++++++++++++++ itstool.spec | 6 +++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 fix-o-output-parameter-is-invalid.patch diff --git a/fix-o-output-parameter-is-invalid.patch b/fix-o-output-parameter-is-invalid.patch new file mode 100644 index 0000000..1c49313 --- /dev/null +++ b/fix-o-output-parameter-is-invalid.patch @@ -0,0 +1,24 @@ +diff -Nur a/itstool.in b/itstool.in +--- a/itstool.in 2023-11-30 11:26:07.087559220 +0800 ++++ b/itstool.in 2023-11-30 11:25:32.059559220 +0800 +@@ -1560,6 +1560,7 @@ + doc.output_test_data(opts.test, out) + else: + messages.output(out) ++ out.flush() + elif opts.merge is not None: + try: + translations = gettext.GNUTranslations(open(opts.merge, 'rb')) +@@ -1605,6 +1606,7 @@ + if fout_is_str: + fout = open(os.path.join(fout, os.path.basename(filename)), 'wb') + fout.write(serialized) ++ fout.flush() + if fout_is_str: + fout.close() + elif opts.join is not None: +@@ -1644,3 +1646,4 @@ + if isinstance(fout, string_types): + fout = open(os.path.join(fout, os.path.basename(filename)), 'w') + fout.write(doc._doc.serialize('utf-8')) ++ fout.flush() diff --git a/itstool.spec b/itstool.spec index 0873429..2d80836 100644 --- a/itstool.spec +++ b/itstool.spec @@ -1,6 +1,6 @@ Name: itstool Version: 2.0.4 -Release: 8 +Release: 9 Summary: ITS-based XML translation tool License: GPLv3+ URL: http://itstool.org/ @@ -9,6 +9,7 @@ Patch0: fix-segfaults.patch Patch1: fix-Cannot-apply-preserveSpace-to-an-attribute.patch Patch2: Auto-update-to-INSTALL-file.patch Patch3: Make-DocBook-keyword-element-within-text.patch +Patch4: fix-o-output-parameter-is-invalid.patch BuildArch: noarch BuildRequires: python3-libxml2 python3-devel git @@ -45,6 +46,9 @@ export PYTHON=%{__python3} %doc %{_mandir}/man1/itstool.1.gz %changelog +* Thu Nov 30 2023 liyanan - 2.0.4-9 +- fix -o -output parameter is invalid + * Fri Nov 26 2023 fandehui fandehui@xfusion.com - 2.0.4-8 - Make DocBook keyword element within text -- Gitee