View | Details | Raw Unified | Return to bug 244325
Collapse All | Expand All

(-)textproc/itstool/Makefile (-2 / +3 lines)
Lines 3-10 Link Here
3
#   $MCom: ports/trunk/textproc/itstool/Makefile 19804 2014-08-13 14:55:11Z kwm $
3
#   $MCom: ports/trunk/textproc/itstool/Makefile 19804 2014-08-13 14:55:11Z kwm $
4
4
5
PORTNAME=	itstool
5
PORTNAME=	itstool
6
PORTVERSION=	2.0.5
6
PORTVERSION=	2.0.6
7
PORTREVISION=	2
8
CATEGORIES=	textproc
7
CATEGORIES=	textproc
9
MASTER_SITES=	http://files.itstool.org/itstool/
8
MASTER_SITES=	http://files.itstool.org/itstool/
10
9
Lines 20-25 Link Here
20
GNU_CONFIGURE=	yes
19
GNU_CONFIGURE=	yes
21
20
22
CONFLICTS_INSTALL=	itstool22
21
CONFLICTS_INSTALL=	itstool22
22
23
NO_ARCH=	yes
23
24
24
post-patch:
25
post-patch:
25
	@${REINPLACE_CMD} -e 's|@PYTHON@|${PYTHON_CMD}|g' \
26
	@${REINPLACE_CMD} -e 's|@PYTHON@|${PYTHON_CMD}|g' \
(-)textproc/itstool/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1547069695
1
TIMESTAMP = 1582405002
2
SHA256 (itstool-2.0.5.tar.bz2) = 100506f8df62cca6225ec3e631a8237e9c04650c77495af4919ac6a100d4b308
2
SHA256 (itstool-2.0.6.tar.bz2) = 6233cc22726a9a5a83664bf67d1af79549a298c23185d926c3677afa917b92a9
3
SIZE (itstool-2.0.5.tar.bz2) = 102751
3
SIZE (itstool-2.0.6.tar.bz2) = 103067
(-)textproc/itstool/files/patch-PR18 (+88 lines)
Line 0 Link Here
1
# https://github.com/itstool/itstool/pull/18
2
# https://github.com/itstool/itstool/issues/17
3
4
From 98d04cdabf1721cb541ecd234c975f13fde4fa41 Mon Sep 17 00:00:00 2001
5
From: Guido Trentalancia <guido@trentalancia.com>
6
Date: Wed, 1 Nov 2017 18:20:36 +0100
7
Subject: [PATCH 1/2] Revert "Be more careful about libxml2 memory management"
8
9
This reverts commit 9b84c007a73e8275ca45762f1bfa3ab7c3a852e2.
10
---
11
 itstool.in | 13 ++-----------
12
 1 file changed, 2 insertions(+), 11 deletions(-)
13
14
diff --git itstool.in itstool.in
15
index a16eba9..c1d0585 100755
16
--- itstool.in
17
+++ itstool.in
18
@@ -477,7 +477,6 @@ class Document (object):
19
         if load_dtd:
20
             ctxt.loadSubset(1)
21
         if keep_entities:
22
-            ctxt.loadSubset(1)
23
             ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
24
             ctxt.replaceEntities(0)
25
         else:
26
@@ -1044,7 +1043,6 @@ class Document (object):
27
         if self._load_dtd:
28
             ctxt.loadSubset(1)
29
         if self._keep_entities:
30
-            ctxt.loadSubset(1)
31
             ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
32
             ctxt.replaceEntities(0)
33
         else:
34
@@ -1071,9 +1069,7 @@ class Document (object):
35
                     ph_node = msg.get_placeholder(child.name).node
36
                     if self.has_child_elements(ph_node):
37
                         self.merge_translations(translations, None, ph_node, strict=strict)
38
-                        newnode = ph_node.copyNode(1)
39
-                        newnode.setTreeDoc(self._doc)
40
-                        child.replaceNode(newnode)
41
+                        child.replaceNode(ph_node)
42
                     else:
43
                         repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
44
                         child.replaceNode(repl)
45
@@ -1088,15 +1084,10 @@ class Document (object):
46
                     (lang + ' ') if lang is not None else '',
47
                     msgstr.encode('utf-8')))
48
                 self._xml_err = ''
49
-                ctxt.doc().freeDoc()
50
                 return node
51
         retnode = node.copyNode(2)
52
-        retnode.setTreeDoc(self._doc)
53
         for child in xml_child_iter(trnode):
54
-            newnode = child.copyNode(1)
55
-            newnode.setTreeDoc(self._doc)
56
-            retnode.addChild(newnode)
57
-
58
+            retnode.addChild(child.copyNode(1))
59
         ctxt.doc().freeDoc()
60
         return retnode
61
 
62
63
From 1549b6d12eb2f35e5c7f1b1856c21768e92ba794 Mon Sep 17 00:00:00 2001
64
From: Guido Trentalancia <guido@trentalancia.com>
65
Date: Wed, 1 Nov 2017 18:23:44 +0100
66
Subject: [PATCH 2/2] Fix a segmentation fault bug introduced with version
67
 2.0.4.
68
69
https://github.com/itstool/itstool/issues/17
70
71
This fix seems a lot easier than the previous reverted commit.
72
---
73
 itstool.in | 2 +-
74
 1 file changed, 1 insertion(+), 1 deletion(-)
75
76
diff --git itstool.in itstool.in
77
index c1d0585..e492e95 100755
78
--- itstool.in
79
+++ itstool.in
80
@@ -1048,7 +1048,7 @@ class Document (object):
81
         else:
82
             ctxt.replaceEntities(1)
83
         ctxt.parseDocument()
84
-        trnode = ctxt.doc().getRootElement()
85
+        trnode = ctxt.doc().getRootElement().copyNode(1)
86
         try:
87
             self._check_errors()
88
         except libxml2.parserError:

Return to bug 244325