[gettext/f16] branch f16 and backport bundled(gnulib) and xgettext crash fix from rawhide/f17
Jens Petersen
petersen at fedoraproject.org
Fri Jun 1 06:15:49 UTC 2012
commit 3b29a530734dd4635e4eebaaecb2eb370d9c5a55
Author: Jens Petersen <petersen at redhat.com>
Date: Fri Jun 1 15:15:43 2012 +0900
branch f16 and backport bundled(gnulib) and xgettext crash fix from rawhide/f17
- branched since f17 contains UsrMove changes that can't be backported
gettext-0.18.1-fix-xgettext-crash.patch | 109 +++++++++++++++++++++++++++++++
gettext.spec | 18 +++++-
2 files changed, 125 insertions(+), 2 deletions(-)
---
diff --git a/gettext-0.18.1-fix-xgettext-crash.patch b/gettext-0.18.1-fix-xgettext-crash.patch
new file mode 100644
index 0000000..d94223f
--- /dev/null
+++ b/gettext-0.18.1-fix-xgettext-crash.patch
@@ -0,0 +1,109 @@
+From: Bruno Haible <bruno at clisp.org>
+Subject: Fix xgettext crash when extracting a message with plural that is excluded.
+Bug-Debian: http://bugs.debian.org/608181
+X-Debian-version: 0.18.1.1-4
+
+--- a/gettext-tools/src/xgettext.c
++++ b/gettext-tools/src/xgettext.c
+@@ -1,5 +1,5 @@
+ /* Extracts strings from C source file to Uniforum style .po file.
+- Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc.
++ Copyright (C) 1995-1998, 2000-2011 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper at gnu.ai.mit.edu>, April 1995.
+
+ This program is free software: you can redistribute it and/or modify
+@@ -2933,7 +2933,7 @@
+ msgid_context,
+ &best_cp->msgid_pos,
+ NULL, best_cp->msgid_comment);
+- if (best_cp->msgid_plural != NULL)
++ if (mp != NULL && best_cp->msgid_plural != NULL)
+ remember_a_message_plural (mp, best_cp->msgid_plural,
+ msgid_plural_context,
+ &best_cp->msgid_plural_pos,
+--- a/gettext-tools/src/xgettext.h
++++ b/gettext-tools/src/xgettext.h
+@@ -1,5 +1,5 @@
+ /* xgettext common functions.
+- Copyright (C) 2001-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
++ Copyright (C) 2001-2003, 2005-2006, 2008-2009, 2011 Free Software Foundation, Inc.
+ Written by Peter Miller <millerp at canb.auug.org.au>
+ and Bruno Haible <haible at clisp.cons.org>, 2001.
+
+@@ -247,7 +247,8 @@
+ or NULL.
+ COMMENT may be savable_comment, or it may be a saved copy of savable_comment
+ (then add_reference must be used when saving it, and drop_reference while
+- dropping it). Clear savable_comment. */
++ dropping it). Clear savable_comment.
++ Return the new or found message, or NULL if the message is excluded. */
+ extern message_ty *remember_a_message (message_list_ty *mlp,
+ char *msgctxt,
+ char *msgid,
+--- a/gettext-tools/src/x-smalltalk.c
++++ b/gettext-tools/src/x-smalltalk.c
+@@ -1,5 +1,5 @@
+ /* xgettext Smalltalk backend.
+- Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc.
++ Copyright (C) 2002-2003, 2005-2009, 2011 Free Software Foundation, Inc.
+
+ This file was written by Bruno Haible <haible at clisp.cons.org>, 2002.
+
+@@ -562,9 +562,10 @@
+ lex_pos_ty pos;
+ pos.file_name = logical_file_name;
+ pos.line_number = token.line_number;
+- remember_a_message_plural (plural_mp, token.string,
+- null_context, &pos,
+- savable_comment);
++ if (plural_mp != NULL)
++ remember_a_message_plural (plural_mp, token.string,
++ null_context, &pos,
++ savable_comment);
+ state = 0;
+ break;
+ }
+--- a/gettext-tools/src/x-ycp.c
++++ b/gettext-tools/src/x-ycp.c
+@@ -1,5 +1,5 @@
+ /* xgettext YCP backend.
+- Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc.
++ Copyright (C) 2001-2003, 2005-2009, 2011 Free Software Foundation, Inc.
+
+ This file was written by Bruno Haible <haible at clisp.cons.org>, 2001.
+
+@@ -640,6 +640,7 @@
+ bool in_i18n)
+ {
+ int state; /* 1 or 2 inside _( ... ), otherwise 0 */
++ int plural_state = 0; /* defined only when in states 1 and 2 */
+ message_ty *plural_mp = NULL; /* defined only when in states 1 and 2 */
+ /* Context iterator that will be used if the next token is a '('. */
+ flag_context_list_iterator_ty next_context_iter =
+@@ -678,20 +679,22 @@
+ pos.file_name = logical_file_name;
+ pos.line_number = token.line_number;
+
+- if (plural_mp == NULL)
++ if (plural_state == 0)
+ {
+ /* Seen an msgid. */
+ plural_mp = remember_a_message (mlp, NULL, token.string,
+ inner_context, &pos,
+ NULL, token.comment);
++ plural_state = 1;
+ state = 2;
+ }
+ else
+ {
+ /* Seen an msgid_plural. */
+- remember_a_message_plural (plural_mp, token.string,
+- inner_context, &pos,
+- token.comment);
++ if (plural_mp != NULL)
++ remember_a_message_plural (plural_mp, token.string,
++ inner_context, &pos,
++ token.comment);
+ state = 0;
+ }
+ drop_reference (token.comment);
diff --git a/gettext.spec b/gettext.spec
index 08c6282..d5911cf 100644
--- a/gettext.spec
+++ b/gettext.spec
@@ -6,7 +6,8 @@
Summary: GNU libraries and utilities for producing multi-lingual messages
Name: gettext
Version: 0.18.1.1
-Release: 8%{?dist}
+# branched because of F17 UsrMove changes
+Release: 9.1%{?dist}
License: GPLv3+ and LGPLv2+
Group: Development/Tools
URL: http://www.gnu.org/software/gettext/
@@ -43,7 +44,10 @@ BuildRequires: libcroco-devel
BuildRequires: libunistring-devel
Requires(post): info
Requires(preun): info
+# exception for bundled gnulib copylib
+Provides: bundled(gnulib)
Patch1: gettext-readlink-einval.patch
+Patch2: gettext-0.18.1-fix-xgettext-crash.patch
%description
The GNU gettext package provides a set of tools and documentation for
@@ -130,6 +134,7 @@ Emacs.
%prep
%setup -q
%patch1 -p1 -b .orig
+%patch2 -p1 -b .crash
%build
@@ -141,7 +146,7 @@ export JAR=fastjar
%endif
# --disable-rpath doesn't work properly on lib64
%configure --without-included-gettext --enable-nls --disable-static \
- --enable-shared --with-pic-=yes --disable-csharp --disable-rpath \
+ --enable-shared --with-pic --disable-csharp --disable-rpath \
%if %{with java}
--enable-java \
%else
@@ -333,6 +338,15 @@ fi
%{_emacs_sitelispdir}/%{name}/*.el
%changelog
+* Fri Jun 1 2012 Jens Petersen <petersen at redhat.com> - 0.18.1.1-9.1
+- add upstream patch from debian to fix xgettext segfault in
+ remember_a_message_plural (thanks Remi Collet, #826138)
+- base package now provides bundled(gnulib) to make it clear that
+ gettext is built with bundled gnulib (#821757)
+
+* Tue Oct 4 2011 Jens Petersen <petersen at redhat.com> - 0.18.1.1-9
+- correct the configure --with-pic option syntax (Gilles Espinasse)
+
* Wed Sep 28 2011 Jens Petersen <petersen at redhat.com> - 0.18.1.1-8
- add gettext-readlink-einval.patch to fix build on kernel >= 2.6.39 (#739188)
- add optional buildrequires suggested in the DEPENDENCIES file
More information about the scm-commits
mailing list