From e1412a597cc97ee517cb0946aad14982a0756e6e68d96b6d5eb1402ba3d7109c Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Mon, 25 Nov 2013 13:42:37 +0000 Subject: [PATCH] Accepting request 208252 from GNOME:Next - Add itstool-fix-crash.patch: Fixed crash in locale filter and drop rule (bgo#71511). - Update to version 2.0.1: + Reworked default ITS rules for better performance. + Fixed handling of namespace prefixes on elements. OBS-URL: https://build.opensuse.org/request/show/208252 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/itstool?expand=0&rev=18 --- itstool-2.0.0.tar.bz2 | 3 --- itstool-2.0.1.tar.bz2 | 3 +++ itstool-fix-crash.patch | 37 +++++++++++++++++++++++++++++++++++++ itstool.changes | 14 +++++++++++++- itstool.spec | 5 ++++- 5 files changed, 57 insertions(+), 5 deletions(-) delete mode 100644 itstool-2.0.0.tar.bz2 create mode 100644 itstool-2.0.1.tar.bz2 create mode 100644 itstool-fix-crash.patch diff --git a/itstool-2.0.0.tar.bz2 b/itstool-2.0.0.tar.bz2 deleted file mode 100644 index cd0bab1..0000000 --- a/itstool-2.0.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14708111b11b4a70e240e3b404d7a58941e61dbb5caf7e18833294d654c09169 -size 92878 diff --git a/itstool-2.0.1.tar.bz2 b/itstool-2.0.1.tar.bz2 new file mode 100644 index 0000000..c38feff --- /dev/null +++ b/itstool-2.0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec6b1b32403cbe338b6ac63c61ab1ecd361f539a6e41ef50eae56a4f577234d1 +size 93084 diff --git a/itstool-fix-crash.patch b/itstool-fix-crash.patch new file mode 100644 index 0000000..d31669e --- /dev/null +++ b/itstool-fix-crash.patch @@ -0,0 +1,37 @@ +From 46067ed60cbe1e5e3efe176da1f40f8219336490 Mon Sep 17 00:00:00 2001 +From: Shaun McCance +Date: Sun, 24 Nov 2013 14:10:03 -0500 +Subject: [PATCH] Fixed crash in locale filter and drop rule, #715116 + +When the dropped node has no preceding sibling, itstool crashes +because it tries to unlink prev node if it's blank. +--- + itstool.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/itstool.in b/itstool.in +index 150b395..a04ab2b 100755 +--- a/itstool.in ++++ b/itstool.in +@@ -859,7 +859,7 @@ class Document (object): + prev = node.prev + node.unlinkNode() + node.freeNode() +- if prev.isBlankNode(): ++ if prev is not None and prev.isBlankNode(): + prev.unlinkNode() + prev.freeNode() + return +@@ -914,7 +914,7 @@ class Document (object): + prev = node.prev + node.unlinkNode() + node.freeNode() +- if prev.isBlankNode(): ++ if prev is not None and prev.isBlankNode(): + prev.unlinkNode() + prev.freeNode() + return +-- +1.7.1 + + diff --git a/itstool.changes b/itstool.changes index 435bcc4..5a8382c 100644 --- a/itstool.changes +++ b/itstool.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Nov 25 08:50:55 UTC 2013 - dimstar@opensuse.org + +- Add itstool-fix-crash.patch: Fixed crash in locale filter and + drop rule (bgo#71511). + +------------------------------------------------------------------- +Sun Nov 24 12:53:53 UTC 2013 - dimstar@opensuse.org + +- Update to version 2.0.1: + + Reworked default ITS rules for better performance. + ------------------------------------------------------------------- Thu Nov 7 20:18:27 UTC 2013 - dimstar@opensuse.org @@ -9,7 +21,7 @@ Thu Nov 7 20:18:27 UTC 2013 - dimstar@opensuse.org + Support for ITS 2.0 parameters, including user overrides. + Support for ITS 2.0 local withinText attribute. + Fixed handling of localization note inheritance. - + Fixed handling od namespace prefixes on elements. + + Fixed handling of namespace prefixes on elements. + Added option to retain entity references in PO files. + Added option to load external DTDs. + Added built-in rules for DocBook 5. diff --git a/itstool.spec b/itstool.spec index b83a656..6d75fd7 100644 --- a/itstool.spec +++ b/itstool.spec @@ -17,13 +17,15 @@ Name: itstool -Version: 2.0.0 +Version: 2.0.1 Release: 0 Summary: Tool to translate XML documents using PO files License: GPL-3.0+ Group: Development/Tools/Other Url: http://itstool.org Source: http://files.itstool.org/itstool/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM itstool-fix-crash.patch bgo#715116 dimstar@opensuse.org -- Fixed crash in locale filter and drop rule +Patch0: itstool-fix-crash.patch BuildRequires: libxml2-python Requires: libxml2-python BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -37,6 +39,7 @@ Internationalization Tag Set (ITS). %prep %setup -q +%patch0 -p1 sed -i "s:#!/usr/bin/env python:#!/usr/bin/python:" itstool itstool.in %build