update to 2.0.6

This commit is contained in:
chxssg 2020-07-31 09:21:40 +08:00
parent 66ed267af5
commit 284da8991a
4 changed files with 5 additions and 51 deletions

View File

@ -1,48 +0,0 @@
diff --git a/itstool.in b/itstool.in
index c1d0585..a16eba9 100755
--- a/itstool.in
+++ b/itstool.in
@@ -477,6 +477,7 @@ class Document (object):
if load_dtd:
ctxt.loadSubset(1)
if keep_entities:
+ ctxt.loadSubset(1)
ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
ctxt.replaceEntities(0)
else:
@@ -1043,6 +1044,7 @@ class Document (object):
if self._load_dtd:
ctxt.loadSubset(1)
if self._keep_entities:
+ ctxt.loadSubset(1)
ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
ctxt.replaceEntities(0)
else:
@@ -1069,7 +1071,9 @@ class Document (object):
ph_node = msg.get_placeholder(child.name).node
if self.has_child_elements(ph_node):
self.merge_translations(translations, None, ph_node, strict=strict)
- child.replaceNode(ph_node)
+ newnode = ph_node.copyNode(1)
+ newnode.setTreeDoc(self._doc)
+ child.replaceNode(newnode)
else:
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
child.replaceNode(repl)
@@ -1084,10 +1088,15 @@ class Document (object):
(lang + ' ') if lang is not None else '',
msgstr.encode('utf-8')))
self._xml_err = ''
+ ctxt.doc().freeDoc()
return node
retnode = node.copyNode(2)
+ retnode.setTreeDoc(self._doc)
for child in xml_child_iter(trnode):
- retnode.addChild(child.copyNode(1))
+ newnode = child.copyNode(1)
+ newnode.setTreeDoc(self._doc)
+ retnode.addChild(newnode)
+
ctxt.doc().freeDoc()
return retnode

Binary file not shown.

BIN
itstool-2.0.6.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,11 +1,10 @@
Name: itstool
Version: 2.0.4
Release: 5
Version: 2.0.6
Release: 1
Summary: ITS-based XML translation tool
License: GPLv3+
URL: http://itstool.org/
Source0: http://files.itstool.org/itstool/%{name}-%{version}.tar.bz2
Patch0: fix-segfaults.patch
BuildArch: noarch
BuildRequires: python3-libxml2 python3-devel git
@ -42,5 +41,8 @@ export PYTHON=%{__python3}
%doc %{_mandir}/man1/itstool.1.gz
%changelog
* Thu Jul 30 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.6-1
- Update to 2.0.6
* Tue Dec 3 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.0.4-5
- Package init