aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-11-17 10:46:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-11-17 12:26:54 +0000
commit8d7fd98d2c72470b0fb94293148a01ad1a6ef3bc (patch)
treedaafb4cd3fe1f2417b2d937c584a7af81ed8c35f
parent9d27d0cf3f37ce81b1614cfb875ee3c4a8a87b52 (diff)
downloadaports-8d7fd98d2c72470b0fb94293148a01ad1a6ef3bc.tar.bz2
aports-8d7fd98d2c72470b0fb94293148a01ad1a6ef3bc.tar.xz
main/itstool: fix segfault
upstream bug: https://github.com/itstool/itstool/issues/17
-rw-r--r--main/itstool/APKBUILD18
-rw-r--r--main/itstool/fix-segfault.patch25
2 files changed, 30 insertions, 13 deletions
diff --git a/main/itstool/APKBUILD b/main/itstool/APKBUILD
index f40185ac51..d94eca5c5c 100644
--- a/main/itstool/APKBUILD
+++ b/main/itstool/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=itstool
pkgver=2.0.4
-pkgrel=1
+pkgrel=2
pkgdesc="ITS-based XML translation tool"
url="http://itstool.org/"
arch="noarch"
@@ -11,19 +11,10 @@ depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
-source="http://files.itstool.org/itstool/itstool-$pkgver.tar.bz2"
+source="http://files.itstool.org/itstool/itstool-$pkgver.tar.bz2
+ fix-segfault.patch"
builddir="$srcdir"/itstool-$pkgver
-prepare() {
- local i
- cd "$builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
-
build() {
cd "$builddir"
./configure \
@@ -48,4 +39,5 @@ check() {
make check
}
-sha512sums="f5cfa9c75710f9cc43a61caeb92ca04ec77023bce6fb14d770dda82efde2e5d9050245618c249d309227a3d43555cb1739f5fe680b4a370786ed4631fa9ee4b7 itstool-2.0.4.tar.bz2"
+sha512sums="f5cfa9c75710f9cc43a61caeb92ca04ec77023bce6fb14d770dda82efde2e5d9050245618c249d309227a3d43555cb1739f5fe680b4a370786ed4631fa9ee4b7 itstool-2.0.4.tar.bz2
+eb426e7cc9f151154f47b93ef46d6fcfb5fa0982be3bf78863ebf5ea009a89de252a6c63dfb090d76003c47107ebb5d1ac2a7d1ef7db08defe19e32f996dbdbd fix-segfault.patch"
diff --git a/main/itstool/fix-segfault.patch b/main/itstool/fix-segfault.patch
new file mode 100644
index 0000000000..047b691b74
--- /dev/null
+++ b/main/itstool/fix-segfault.patch
@@ -0,0 +1,25 @@
+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] 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 a/itstool.in b/itstool.in
+index c1d0585..e492e95 100755
+--- a/itstool.in
++++ b/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: