commit 06282ff4487515673153ccc79bd04879dd667ae2 Author: Michael Simacek msimacek@redhat.com Date: Mon Feb 16 18:46:18 2015 +0100
Write temporary XML file as UTF-8 in pom_editor
..._editor-Write-temporary-XML-file-as-UTF-8.patch | 27 ++++++++++++++++++++ javapackages-tools.spec | 9 ++++++- 2 files changed, 35 insertions(+), 1 deletions(-) --- diff --git a/0001-pom_editor-Write-temporary-XML-file-as-UTF-8.patch b/0001-pom_editor-Write-temporary-XML-file-as-UTF-8.patch new file mode 100644 index 0000000..a7a26fb --- /dev/null +++ b/0001-pom_editor-Write-temporary-XML-file-as-UTF-8.patch @@ -0,0 +1,27 @@ +From 4374dc79828c75820d119ce221e95b74900afc52 Mon Sep 17 00:00:00 2001 +From: Michael Simacek msimacek@redhat.com +Date: Mon, 16 Feb 2015 17:32:03 +0100 +Subject: [PATCH] [pom_editor] Write temporary XML file as UTF-8 + +--- + java-utils/pom_editor.py | 2 +- + test/data/pom_macros/pom_unicode.xml | 16 ++++++++++++++++ + test/data/pom_macros/pom_unicode.xml-want | 16 ++++++++++++++++ + test/pom_macros_test.py | 7 +++++++ + 4 files changed, 40 insertions(+), 1 deletion(-) + create mode 100644 test/data/pom_macros/pom_unicode.xml + create mode 100644 test/data/pom_macros/pom_unicode.xml-want + +diff --git a/java-utils/pom_editor.py b/java-utils/pom_editor.py +index 1c30878..201ccf1 100644 +--- a/java-utils/pom_editor.py ++++ b/java-utils/pom_editor.py +@@ -212,7 +212,7 @@ class XmlFile(object): + raw_xml = self._preprocess_raw(raw_xml) + self.xml_declaration = re.match(r'<?xml\s[^?]*?>', raw_xml) + tmpfile = self.xmlpath + '.tmp' +- with io.open(tmpfile, 'w') as prepared: ++ with io.open(tmpfile, 'w', encoding='UTF-8') as prepared: + prepared.write(raw_xml) + self.document = etree.parse(tmpfile) + self.tab = get_indent(self.root) diff --git a/javapackages-tools.spec b/javapackages-tools.spec index c7cf59b..7d59873 100644 --- a/javapackages-tools.spec +++ b/javapackages-tools.spec @@ -9,7 +9,7 @@
Name: javapackages-tools Version: 4.4.0 -Release: 1%{?dist} +Release: 2%{?dist}
Summary: Macros and scripts for Java packaging support
@@ -17,6 +17,8 @@ License: BSD URL: https://git.fedorahosted.org/git/javapackages.git Source0: https://fedorahosted.org/released/javapackages/javapackages-%%7Bversion%7D.t...
+Patch0: 0001-pom_editor-Write-temporary-XML-file-as-UTF-8.patch + BuildArch: noarch
%if 0%{?with_python3} @@ -174,6 +176,8 @@ This package provides non-essential macros and scripts to support Java packaging %prep %setup -q -n javapackages-%{version}
+%patch0 -p1 + %build %if 0%{?with_python3} %configure --pyinterpreter=%{__python3} @@ -227,6 +231,9 @@ popd %doc LICENSE
%changelog +* Mon Feb 16 2015 Michael Simacek msimacek@redhat.com - 4.4.0-2 +- Write temporary XML file as UTF-8 in pom_editor + * Mon Feb 16 2015 Michal Srb msrb@redhat.com - 4.4.0-1 - Update to upstream version 4.4.0
java-sig-commits@lists.fedoraproject.org