Hello community, here is the log from the commit of package itstool for openSUSE:Factory checked in at 2012-02-16 16:16:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/itstool (Old) and /work/SRC/openSUSE:Factory/.itstool.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "itstool", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/itstool/itstool.changes 2011-10-02 10:13:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.itstool.new/itstool.changes 2012-02-16 16:17:03.000000000 +0100 @@ -1,0 +2,6 @@ +Sun Feb 5 22:16:33 UTC 2012 - dims...@opensuse.org + +- Update to version 1.1.2: + + Better handling of XML errors in PO files. + +------------------------------------------------------------------- Old: ---- itstool-1.1.1.tar.bz2 New: ---- itstool-1.1.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ itstool.spec ++++++ --- /var/tmp/diff_new_pack.QNpPWi/_old 2012-02-16 16:17:04.000000000 +0100 +++ /var/tmp/diff_new_pack.QNpPWi/_new 2012-02-16 16:17:04.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package itstool # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,18 +15,16 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - - Name: itstool -Version: 1.1.1 -Release: 1 -License: GPL-3.0+ +Version: 1.1.2 +Release: 0 Summary: Tool to translate XML documents using PO files -Url: http://itstool.org +License: GPL-3.0+ Group: Development/Tools/Other +Url: http://itstool.org Source: http://files.itstool.org/itstool/%{name}-%{version}.tar.bz2 -BuildRequires: python BuildRequires: libxml2-python +BuildRequires: python Requires: libxml2-python BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++++++ itstool-1.1.1.tar.bz2 -> itstool-1.1.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/ChangeLog new/itstool-1.1.2/ChangeLog --- old/itstool-1.1.1/ChangeLog 2011-09-19 15:11:34.000000000 +0200 +++ new/itstool-1.1.2/ChangeLog 2012-02-05 17:48:33.000000000 +0100 @@ -1,3 +1,30 @@ +commit ed24c8ab3b22a085daea614638cbc15796011f15 +Author: Shaun McCance <sha...@gnome.org> +Date: Tue Sep 27 10:16:55 2011 -0400 + + Better handling of XML errors in PO files + + Rather than let an exception kill itstool, just issue a warning + and use the original-language node. Added --strict to error out + for XML errors in PO files. + + https://bugs.freedesktop.org/show_bug.cgi?id=41254 + + itstool.in | 38 ++++++++++++++++++++++++++++++-------- + tests/Translate3.ll.wrong.xml | 12 ++++++++++++ + tests/run_tests.py | 23 +++++++++++++++++------ + 3 files changed, 59 insertions(+), 14 deletions(-) + +commit e5c3be76682a1e1d224ad89fa3798cf3a7b81900 +Author: Shaun McCance <sha...@gnome.org> +Date: Mon Sep 19 09:12:30 2011 -0400 + + Version 1.1.1 + + NEWS | 7 +++++++ + configure.ac | 2 +- + 2 files changed, 8 insertions(+), 1 deletions(-) + commit 0520144626db679e81725aebfaba273a52fd0bf4 Merge: 092a264 7e07396 Author: Shaun McCance <sha...@gnome.org> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/NEWS new/itstool-1.1.2/NEWS --- old/itstool-1.1.1/NEWS 2011-09-19 15:11:16.000000000 +0200 +++ new/itstool-1.1.2/NEWS 2012-02-05 17:48:12.000000000 +0100 @@ -1,3 +1,7 @@ +1.1.2 +===== +* Better handling of XML errors in PO files + 1.1.1 ===== * Catch XML parsing errors and exit with error code diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/configure new/itstool-1.1.2/configure --- old/itstool-1.1.1/configure 2011-09-19 15:11:32.000000000 +0200 +++ new/itstool-1.1.2/configure 2012-02-05 17:48:31.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.66 for itstool 1.1.1. +# Generated by GNU Autoconf 2.66 for itstool 1.1.2. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -548,8 +548,8 @@ # Identity of this package. PACKAGE_NAME='itstool' PACKAGE_TARNAME='itstool' -PACKAGE_VERSION='1.1.1' -PACKAGE_STRING='itstool 1.1.1' +PACKAGE_VERSION='1.1.2' +PACKAGE_STRING='itstool 1.1.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1165,7 +1165,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures itstool 1.1.1 to adapt to many kinds of systems. +\`configure' configures itstool 1.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1231,7 +1231,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of itstool 1.1.1:";; + short | recursive ) echo "Configuration of itstool 1.1.2:";; esac cat <<\_ACEOF @@ -1298,7 +1298,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -itstool configure 1.1.1 +itstool configure 1.1.2 generated by GNU Autoconf 2.66 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1315,7 +1315,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by itstool $as_me 1.1.1, which was +It was created by itstool $as_me 1.1.2, which was generated by GNU Autoconf 2.66. Invocation command line was $ $0 $@ @@ -2130,7 +2130,7 @@ # Define the identity of the package. PACKAGE='itstool' - VERSION='1.1.1' + VERSION='1.1.2' cat >>confdefs.h <<_ACEOF @@ -2726,7 +2726,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by itstool $as_me 1.1.1, which was +This file was extended by itstool $as_me 1.1.2, which was generated by GNU Autoconf 2.66. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2779,7 +2779,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -itstool config.status 1.1.1 +itstool config.status 1.1.2 configured by $0, generated by GNU Autoconf 2.66, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/configure.ac new/itstool-1.1.2/configure.ac --- old/itstool-1.1.1/configure.ac 2011-09-19 15:11:21.000000000 +0200 +++ new/itstool-1.1.2/configure.ac 2012-02-05 17:48:20.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([itstool], [1.1.1], []) +AC_INIT([itstool], [1.1.2], []) AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2]) DATADIR=`( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/itstool new/itstool-1.1.2/itstool --- old/itstool-1.1.1/itstool 2011-09-19 15:11:34.000000000 +0200 +++ new/itstool-1.1.2/itstool 2012-02-05 17:48:33.000000000 +0100 @@ -17,7 +17,7 @@ # Place, Suite 330, Boston, MA 0211-1307 USA. # -VERSION="1.1.1" +VERSION="1.1.2" DATADIR="/usr/local/share" import gettext @@ -318,7 +318,11 @@ self._localrules.append(child) pre_process(child) pre_process(self._doc) - self._check_errors() + try: + self._check_errors() + except libxml2.parserError as e: + sys.stderr.write('Error: Could not parse document:\n%s\n' % str(e)) + sys.exit(1) self._msgs = messages self._its_translate_nodes = {} self._its_within_text_nodes = {} @@ -583,7 +587,7 @@ for node in xml_child_iter(self._itst_credits[1]): self._append_credits(self._itst_credits[0], node, trdata) - def merge_translations(self, translations, language, node=None): + def merge_translations(self, translations, language, node=None, strict=False): is_root = False if node is None: is_root = True @@ -607,9 +611,9 @@ self.translate_attrs(node, node) children = [child for child in xml_child_iter(node)] for child in children: - self.merge_translations(translations, language, node=child) + self.merge_translations(translations, language, node=child, strict=strict) else: - newnode = self.get_translated(node, translations) + newnode = self.get_translated(node, translations, strict=strict) if newnode != node: self.translate_attrs(node, newnode) node.replaceNode(newnode) @@ -663,7 +667,7 @@ if newcontent: newnode.setProp(attr.name, translations.ugettext(attr.get_content())) - def get_translated (self, node, translations): + def get_translated (self, node, translations, strict=False): msg = self._msgs.get_message_by_node(node) if msg is None: return node @@ -697,6 +701,15 @@ ctxt.replaceEntities(0) ctxt.parseDocument() trnode = ctxt.doc().getRootElement() + try: + self._check_errors() + except libxml2.parserError as e: + if strict: + raise + else: + sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' % msgstr) + self._xml_err = '' + return node def scan_node(node): children = [child for child in xml_child_iter(node)] for child in children: @@ -705,10 +718,10 @@ if child.ns() is not None and child.ns().content == NS_BLANK: ph_node = msg.get_placeholder(child.name).node if self.has_child_elements(ph_node): - self.merge_translations(translations, None, ph_node) + self.merge_translations(translations, None, ph_node, strict=strict) child.replaceNode(ph_node) else: - repl = self.get_translated(ph_node, translations) + repl = self.get_translated(ph_node, translations, strict=strict) child.replaceNode(repl) scan_node(child) scan_node(trnode) @@ -914,6 +927,11 @@ default=None, metavar='OUT', help='output PO files to file OUT or XML files in directory OUT') + options.add_option('-s', '--strict', + action='store_true', + dest='strict', + default=False, + help='Exit with error when PO files contain broken XML') options.add_option('-v', '--version', action='store_true', dest='version', @@ -971,7 +989,11 @@ if opts.itsfile is not None: for itsfile in opts.itsfile: doc.apply_its_file(itsfile) - doc.merge_translations(translations, opts.lang) + try: + doc.merge_translations(translations, opts.lang, strict=opts.strict) + except Exception as e: + sys.stderr.write('Error: Could not merge translations:\n%s\n' % str(e)) + sys.exit(1) fout = out if isinstance(fout, basestring): fout = file(os.path.join(fout, os.path.basename(filename)), 'w') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/itstool.1 new/itstool-1.1.2/itstool.1 --- old/itstool-1.1.1/itstool.1 2011-09-19 15:11:34.000000000 +0200 +++ new/itstool-1.1.2/itstool.1 2012-02-05 17:48:33.000000000 +0100 @@ -1,4 +1,4 @@ -.TH ITSTOOL "1" "May 2011" "itstool 1.1.1" +.TH ITSTOOL "1" "May 2011" "itstool 1.1.2" .SH NAME itstool \- convert between XML and PO using ITS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/itstool-1.1.1/itstool.in new/itstool-1.1.2/itstool.in --- old/itstool-1.1.1/itstool.in 2011-09-03 19:23:20.000000000 +0200 +++ new/itstool-1.1.2/itstool.in 2011-09-27 16:18:30.000000000 +0200 @@ -318,7 +318,11 @@ self._localrules.append(child) pre_process(child) pre_process(self._doc) - self._check_errors() + try: + self._check_errors() + except libxml2.parserError as e: + sys.stderr.write('Error: Could not parse document:\n%s\n' % str(e)) + sys.exit(1) self._msgs = messages self._its_translate_nodes = {} self._its_within_text_nodes = {} @@ -583,7 +587,7 @@ for node in xml_child_iter(self._itst_credits[1]): self._append_credits(self._itst_credits[0], node, trdata) - def merge_translations(self, translations, language, node=None): + def merge_translations(self, translations, language, node=None, strict=False): is_root = False if node is None: is_root = True @@ -607,9 +611,9 @@ self.translate_attrs(node, node) children = [child for child in xml_child_iter(node)] for child in children: - self.merge_translations(translations, language, node=child) + self.merge_translations(translations, language, node=child, strict=strict) else: - newnode = self.get_translated(node, translations) + newnode = self.get_translated(node, translations, strict=strict) if newnode != node: self.translate_attrs(node, newnode) node.replaceNode(newnode) @@ -663,7 +667,7 @@ if newcontent: newnode.setProp(attr.name, translations.ugettext(attr.get_content())) - def get_translated (self, node, translations): + def get_translated (self, node, translations, strict=False): msg = self._msgs.get_message_by_node(node) if msg is None: return node @@ -697,6 +701,15 @@ ctxt.replaceEntities(0) ctxt.parseDocument() trnode = ctxt.doc().getRootElement() + try: + self._check_errors() + except libxml2.parserError as e: + if strict: + raise + else: + sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' % msgstr) + self._xml_err = '' + return node def scan_node(node): children = [child for child in xml_child_iter(node)] for child in children: @@ -705,10 +718,10 @@ if child.ns() is not None and child.ns().content == NS_BLANK: ph_node = msg.get_placeholder(child.name).node if self.has_child_elements(ph_node): - self.merge_translations(translations, None, ph_node) + self.merge_translations(translations, None, ph_node, strict=strict) child.replaceNode(ph_node) else: - repl = self.get_translated(ph_node, translations) + repl = self.get_translated(ph_node, translations, strict=strict) child.replaceNode(repl) scan_node(child) scan_node(trnode) @@ -914,6 +927,11 @@ default=None, metavar='OUT', help='output PO files to file OUT or XML files in directory OUT') + options.add_option('-s', '--strict', + action='store_true', + dest='strict', + default=False, + help='Exit with error when PO files contain broken XML') options.add_option('-v', '--version', action='store_true', dest='version', @@ -971,7 +989,11 @@ if opts.itsfile is not None: for itsfile in opts.itsfile: doc.apply_its_file(itsfile) - doc.merge_translations(translations, opts.lang) + try: + doc.merge_translations(translations, opts.lang, strict=opts.strict) + except Exception as e: + sys.stderr.write('Error: Could not merge translations:\n%s\n' % str(e)) + sys.exit(1) fout = out if isinstance(fout, basestring): fout = file(os.path.join(fout, os.path.basename(filename)), 'w') -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org