pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/itstool itstool: Apply upstream fix for itsto...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/789865832d62
branches:  trunk
changeset: 372748:789865832d62
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Fri Dec 15 09:14:52 2017 +0000

description:
itstool: Apply upstream fix for itstool/itstool#17.

Fixes segfaults breaking various dependencies.  Bump PKGREVISION.

diffstat:

 textproc/itstool/Makefile                 |   3 +-
 textproc/itstool/distinfo                 |   3 +-
 textproc/itstool/patches/patch-itstool.in |  50 +++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 2 deletions(-)

diffs (78 lines):

diff -r 914873a76630 -r 789865832d62 textproc/itstool/Makefile
--- a/textproc/itstool/Makefile Fri Dec 15 07:54:18 2017 +0000
+++ b/textproc/itstool/Makefile Fri Dec 15 09:14:52 2017 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.14 2017/11/06 18:28:22 prlw1 Exp $
+# $NetBSD: Makefile,v 1.15 2017/12/15 09:14:52 jperkin Exp $
 
 DISTNAME=      itstool-2.0.4
+PKGREVISION=   1
 CATEGORIES=    textproc
 MASTER_SITES=  http://files.itstool.org/itstool/
 EXTRACT_SUFX=  .tar.bz2
diff -r 914873a76630 -r 789865832d62 textproc/itstool/distinfo
--- a/textproc/itstool/distinfo Fri Dec 15 07:54:18 2017 +0000
+++ b/textproc/itstool/distinfo Fri Dec 15 09:14:52 2017 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.7 2017/11/06 18:28:22 prlw1 Exp $
+$NetBSD: distinfo,v 1.8 2017/12/15 09:14:52 jperkin Exp $
 
 SHA1 (itstool-2.0.4.tar.bz2) = 5345615becb5c463c6e7f2462e387fdc327f3a35
 RMD160 (itstool-2.0.4.tar.bz2) = 7237fd8b3fb2d354135fdf16caeeb03b9a022e14
 SHA512 (itstool-2.0.4.tar.bz2) = f5cfa9c75710f9cc43a61caeb92ca04ec77023bce6fb14d770dda82efde2e5d9050245618c249d309227a3d43555cb1739f5fe680b4a370786ed4631fa9ee4b7
 Size (itstool-2.0.4.tar.bz2) = 102107 bytes
+SHA1 (patch-itstool.in) = 70ce932b2c4b816ebd1c295b0d87a114ddde9d06
diff -r 914873a76630 -r 789865832d62 textproc/itstool/patches/patch-itstool.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/itstool/patches/patch-itstool.in Fri Dec 15 09:14:52 2017 +0000
@@ -0,0 +1,50 @@
+$NetBSD: patch-itstool.in,v 1.1 2017/12/15 09:14:52 jperkin Exp $
+
+Apply upstream fix for https://github.com/itstool/itstool/issues/17
+
+--- itstool.in.orig    2017-12-15 09:05:24.914034930 +0000
++++ 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
+ 



Home | Main Index | Thread Index | Old Index