Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2020 15:00:06 +0000 (UTC)
From:      "Danilo G. Baio" <dbaio@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r528414 - in head/textproc/itstool: . files
Message-ID:  <202003141500.02EF06kK019599@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dbaio
Date: Sat Mar 14 15:00:06 2020
New Revision: 528414
URL: https://svnweb.freebsd.org/changeset/ports/528414

Log:
  textproc/itstool: Update to 2.0.6, Add patch to fix some libxml issues [1]
  
  FreeBSD Doc translations are working fine with this patch.
  More details on https://github.com/itstool/itstool/issues/38
  
  PR:		244325
  Approved by:	maintainer timeout (kwm, > 3 weeks)
  Obtained from:	https://github.com/itstool/itstool/pull/18 [1]

Added:
  head/textproc/itstool/files/patch-PR18   (contents, props changed)
Modified:
  head/textproc/itstool/Makefile
  head/textproc/itstool/distinfo

Modified: head/textproc/itstool/Makefile
==============================================================================
--- head/textproc/itstool/Makefile	Sat Mar 14 14:46:18 2020	(r528413)
+++ head/textproc/itstool/Makefile	Sat Mar 14 15:00:06 2020	(r528414)
@@ -3,8 +3,7 @@
 #   $MCom: ports/trunk/textproc/itstool/Makefile 19804 2014-08-13 14:55:11Z kwm $
 
 PORTNAME=	itstool
-PORTVERSION=	2.0.5
-PORTREVISION=	2
+PORTVERSION=	2.0.6
 CATEGORIES=	textproc
 MASTER_SITES=	http://files.itstool.org/itstool/
 
@@ -20,6 +19,8 @@ USES=		python tar:bzip2
 GNU_CONFIGURE=	yes
 
 CONFLICTS_INSTALL=	itstool22
+
+NO_ARCH=	yes
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|@PYTHON@|${PYTHON_CMD}|g' \

Modified: head/textproc/itstool/distinfo
==============================================================================
--- head/textproc/itstool/distinfo	Sat Mar 14 14:46:18 2020	(r528413)
+++ head/textproc/itstool/distinfo	Sat Mar 14 15:00:06 2020	(r528414)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1547069695
-SHA256 (itstool-2.0.5.tar.bz2) = 100506f8df62cca6225ec3e631a8237e9c04650c77495af4919ac6a100d4b308
-SIZE (itstool-2.0.5.tar.bz2) = 102751
+TIMESTAMP = 1582405002
+SHA256 (itstool-2.0.6.tar.bz2) = 6233cc22726a9a5a83664bf67d1af79549a298c23185d926c3677afa917b92a9
+SIZE (itstool-2.0.6.tar.bz2) = 103067

Added: head/textproc/itstool/files/patch-PR18
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/itstool/files/patch-PR18	Sat Mar 14 15:00:06 2020	(r528414)
@@ -0,0 +1,88 @@
+# https://github.com/itstool/itstool/pull/18
+# https://github.com/itstool/itstool/issues/17
+
+From 98d04cdabf1721cb541ecd234c975f13fde4fa41 Mon Sep 17 00:00:00 2001
+From: Guido Trentalancia <guido@trentalancia.com>
+Date: Wed, 1 Nov 2017 18:20:36 +0100
+Subject: [PATCH 1/2] Revert "Be more careful about libxml2 memory management"
+
+This reverts commit 9b84c007a73e8275ca45762f1bfa3ab7c3a852e2.
+---
+ itstool.in | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git itstool.in itstool.in
+index a16eba9..c1d0585 100755
+--- itstool.in
++++ itstool.in
+@@ -477,7 +477,6 @@ 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:
+@@ -1044,7 +1043,6 @@ 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:
+@@ -1071,9 +1069,7 @@ 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)
+-                        newnode = ph_node.copyNode(1)
+-                        newnode.setTreeDoc(self._doc)
+-                        child.replaceNode(newnode)
++                        child.replaceNode(ph_node)
+                     else:
+                         repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
+                         child.replaceNode(repl)
+@@ -1088,15 +1084,10 @@ 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):
+-            newnode = child.copyNode(1)
+-            newnode.setTreeDoc(self._doc)
+-            retnode.addChild(newnode)
+-
++            retnode.addChild(child.copyNode(1))
+         ctxt.doc().freeDoc()
+         return retnode
+ 
+
+From 1549b6d12eb2f35e5c7f1b1856c21768e92ba794 Mon Sep 17 00:00:00 2001
+From: Guido Trentalancia <guido@trentalancia.com>
+Date: Wed, 1 Nov 2017 18:23:44 +0100
+Subject: [PATCH 2/2] Fix a segmentation fault bug introduced with version
+ 2.0.4.
+
+https://github.com/itstool/itstool/issues/17
+
+This fix seems a lot easier than the previous reverted commit.
+---
+ itstool.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git itstool.in itstool.in
+index c1d0585..e492e95 100755
+--- itstool.in
++++ itstool.in
+@@ -1048,7 +1048,7 @@ class Document (object):
+         else:
+             ctxt.replaceEntities(1)
+         ctxt.parseDocument()
+-        trnode = ctxt.doc().getRootElement()
++        trnode = ctxt.doc().getRootElement().copyNode(1)
+         try:
+             self._check_errors()
+         except libxml2.parserError:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003141500.02EF06kK019599>