Imported Upstream version 2.0.4 63/195163/1 upstream/2.0.4
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 11 Dec 2018 07:08:59 +0000 (16:08 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 11 Dec 2018 07:08:59 +0000 (16:08 +0900)
Change-Id: I6067d16cc3dffe21c8fa02aba7b12e6b7e26857b
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
ChangeLog
NEWS
configure
configure.ac
itstool
itstool.1
itstool.in
setup.py

index 8548a430ed6479b458cd05e19998c0739fa16652..e9504159c7147dc92e23ae579706784002ee5593 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+commit 07b7b6c207f9684ef610a738bd8a9314179e6a72
+Author: Shaun McCance <shaunm@redhat.com>
+Date:   Mon Oct 16 11:55:12 2017 -0400
+
+    Use $PYTHON for libxml2 check to use the right python
+    
+    Fixes https://github.com/itstool/itstool/issues/16
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c6419a81c35da62d577b43e8f5c4b53a0c92e0fa
+Author: Shaun McCance <shaunm@redhat.com>
+Date:   Mon Oct 16 11:51:53 2017 -0400
+
+    Update INSTALL file
+
+ INSTALL | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+commit d3adf0264ee2b6fd28b7eff7dec33501d6e75a7c
+Author: Shaun McCance <shaunm@redhat.com>
+Date:   Wed Oct 11 23:12:38 2017 -0400
+
+    Fix massive performance issue
+    
+    Fixed https://github.com/itstool/itstool/issues/15
+
+ itstool.in | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+commit f1934cffa7f1809321f68fc156c7039fdb27673b
+Author: Shaun McCance <shaunm@redhat.com>
+Date:   Wed Oct 4 13:28:48 2017 -0400
+
+    Version 2.0.3
+
+ NEWS         | 8 ++++++++
+ configure.ac | 2 +-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
 commit c12b29db71ec860ec9d15e2ef6e5bdf2a82355cd
 Merge: 204ed57 717ea02
 Author: Shaun McCance <shaunm@gnome.org>
diff --git a/NEWS b/NEWS
index 1f5a415f1ea1d48f29aee6f81a8ed379d4841568..2e88d6ae14aaf0e10fd338b868b6c2de157b8379 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+2.0.4
+=====
+* Fixed a massive performance issue
+
 2.0.3
 =====
 * Added Python 3 support. Keeping Python 2 support for now. (Virgil Dupras)
index 5766b759d2d618493f631eec651be3b4e83cc77d..7db926b5dcbd2c0600d38f60131ab3ce45791906 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for itstool 2.0.3.
+# Generated by GNU Autoconf 2.69 for itstool 2.0.4.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -576,8 +576,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='itstool'
 PACKAGE_TARNAME='itstool'
-PACKAGE_VERSION='2.0.3'
-PACKAGE_STRING='itstool 2.0.3'
+PACKAGE_VERSION='2.0.4'
+PACKAGE_STRING='itstool 2.0.4'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1207,7 +1207,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures itstool 2.0.3 to adapt to many kinds of systems.
+\`configure' configures itstool 2.0.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1273,7 +1273,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of itstool 2.0.3:";;
+     short | recursive ) echo "Configuration of itstool 2.0.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1353,7 +1353,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-itstool configure 2.0.3
+itstool configure 2.0.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1370,7 +1370,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by itstool $as_me 2.0.3, which was
+It was created by itstool $as_me 2.0.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2233,7 +2233,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='itstool'
- VERSION='2.0.3'
+ VERSION='2.0.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2601,7 +2601,7 @@ $as_echo "$am_cv_python_pyexecdir" >&6; }
 py_module=libxml2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module $py_module" >&5
 $as_echo_n "checking for python module $py_module... " >&6; }
-echo "import $py_module" | python - &>/dev/null
+echo "import $py_module" | $PYTHON - &>/dev/null
 if test $? -ne 0; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
 $as_echo "not found" >&6; }
@@ -3165,7 +3165,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by itstool $as_me 2.0.3, which was
+This file was extended by itstool $as_me 2.0.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3218,7 +3218,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-itstool config.status 2.0.3
+itstool config.status 2.0.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 2116c567dd9d20d6d58ba45f8d5474284c699a8c..18efd0c469e7389d45562d55cf73a456d7cf53aa 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT([itstool], [2.0.3], [])
+AC_INIT([itstool], [2.0.4], [])
 AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
 
 DATADIR=`(
@@ -14,7 +14,7 @@ AM_PATH_PYTHON([2.6])
 
 py_module=libxml2
 AC_MSG_CHECKING(for python module $py_module)
-echo "import $py_module" | python - &>/dev/null
+echo "import $py_module" | $PYTHON - &>/dev/null
 if test $? -ne 0; then
        AC_MSG_RESULT(not found)
        AC_MSG_ERROR(Python module $py_module is needed to run this package)
diff --git a/itstool b/itstool
index ca37a1227b076cc1263a7ab8f46083947a6afb76..6e402e26c39308969e1d5396d5f87b6e1cfd682a 100644 (file)
--- a/itstool
+++ b/itstool
@@ -1,4 +1,4 @@
-#!/usr/bin/python -s
+#!/usr/bin/python3 -s
 #
 # Copyright (c) 2010-2013 Shaun McCance <shaunm@gnome.org>
 #
@@ -19,7 +19,7 @@
 from __future__ import print_function
 from __future__ import unicode_literals
 
-VERSION="2.0.3"
+VERSION="2.0.4"
 DATADIR="/usr/local/share"
 
 import gettext
@@ -553,6 +553,9 @@ class Document (object):
         self._itst_credits = None
         self._its_externals = {}
 
+    def __del__ (self):
+        self._doc.freeDoc()
+
     def _check_errors(self):
         if self._xml_err:
             raise libxml2.parserError(self._xml_err)
@@ -1039,8 +1042,11 @@ class Document (object):
         ctxt = libxml2.createDocParserCtxt(blurb)
         if self._load_dtd:
             ctxt.loadSubset(1)
-        ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
-        ctxt.replaceEntities(0)
+        if self._keep_entities:
+            ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
+            ctxt.replaceEntities(0)
+        else:
+            ctxt.replaceEntities(1)
         ctxt.parseDocument()
         trnode = ctxt.doc().getRootElement()
         try:
@@ -1082,6 +1088,7 @@ class Document (object):
         retnode = node.copyNode(2)
         for child in xml_child_iter(trnode):
             retnode.addChild(child.copyNode(1))
+        ctxt.doc().freeDoc()
         return retnode
 
     def generate_messages(self, comments=True):
index 77deef3b2d4c9f755fb1ec14773b25136ab114f7..8b7ecbbb63c6c6897c01236288fde3f8cd50f34a 100644 (file)
--- a/itstool.1
+++ b/itstool.1
@@ -1,4 +1,4 @@
-.TH "ITSTOOL" "1" "December 2013" "itstool 2.0.3"
+.TH "ITSTOOL" "1" "December 2013" "itstool 2.0.4"
 
 .SH "NAME"
 itstool \- convert between XML and PO using ITS
index 60f73dd730c2fb37d76b5d62e88ea285e99effc3..c1d05857de52e7aca2b521bf6f1645d16e431b4f 100755 (executable)
@@ -553,6 +553,9 @@ class Document (object):
         self._itst_credits = None
         self._its_externals = {}
 
+    def __del__ (self):
+        self._doc.freeDoc()
+
     def _check_errors(self):
         if self._xml_err:
             raise libxml2.parserError(self._xml_err)
@@ -1039,8 +1042,11 @@ class Document (object):
         ctxt = libxml2.createDocParserCtxt(blurb)
         if self._load_dtd:
             ctxt.loadSubset(1)
-        ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
-        ctxt.replaceEntities(0)
+        if self._keep_entities:
+            ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
+            ctxt.replaceEntities(0)
+        else:
+            ctxt.replaceEntities(1)
         ctxt.parseDocument()
         trnode = ctxt.doc().getRootElement()
         try:
@@ -1082,6 +1088,7 @@ class Document (object):
         retnode = node.copyNode(2)
         for child in xml_child_iter(trnode):
             retnode.addChild(child.copyNode(1))
+        ctxt.doc().freeDoc()
         return retnode
 
     def generate_messages(self, comments=True):
index e8b6102854b63d579be022e89cc711f3a2a66549..8dd9c38fd01a6600f8cee6addcd811dcf2982f0b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
 from distutils.core import setup
 
 setup(name='itstool',
-      version='2.0.3',
+      version='2.0.4',
       description='XML to PO and back again using W3C ITS rules',
       author='Shaun McCance',
       author_email='shaunm@gnome.org',