Hello community, here is the log from the commit of package gettext checked in at Thu Sep 13 18:36:41 CEST 2007. -------- --- gettext/gettext.changes 2007-08-15 21:14:37.000000000 +0200 +++ /mounts/work_src_done/STABLE/gettext/gettext.changes 2007-09-03 13:53:37.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Sep 3 13:51:10 CEST 2007 - pth@suse.de + +- Incorporate upstream patch that correctly fixes the expat + dynloading code (http://savannah.gnu.org/bugs/?19585). + +------------------------------------------------------------------- gettext-java.changes: same change Old: ---- bug287150-ycp-comments.diff gettext-expat_check.patch New: ---- gettext-bug287150-ycp-comments.patch gettext-expat_dynload_fix.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gettext-java.spec ++++++ --- /var/tmp/diff_new_pack.o24281/_old 2007-09-13 18:36:03.000000000 +0200 +++ /var/tmp/diff_new_pack.o24281/_new 2007-09-13 18:36:03.000000000 +0200 @@ -17,7 +17,7 @@ Group: Development/Tools/Other Autoreqprov: on Version: 0.16 -Release: 55 +Release: 66 Summary: Java Support for Native Language Support (NLS) PreReq: %{install_info_prereq} BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -31,8 +31,8 @@ Patch5: gettext-initialize_vars.patch Patch6: gettext-0.15-docdir.diff Patch7: gettext-autotools.patch -Patch8: gettext-expat_check.patch Patch9: fixes-from-gettext-0.16.1.diff +Patch10: gettext-expat_dynload_fix.patch %description This package includes the tools needed to support message catalogs in @@ -55,8 +55,8 @@ %patch5 %patch6 -p1 %patch7 -%patch8 %patch9 -p1 +%patch10 rename no nb gettext-tools/po/no.* rename no nb gettext-runtime/po/no.* pushd gettext-tools/misc @@ -137,6 +137,9 @@ %_libdir/gettext/gnu.gettext.GetURL %changelog +* Mon Sep 03 2007 - pth@suse.de +- Incorporate upstream patch that correctly fixes the expat + dynloading code (http://savannah.gnu.org/bugs/?19585). * Thu Aug 09 2007 - bk@suse.de - re-enable make check to identify possible toolchain bugs - move java documentation from gettext to this package ++++++ gettext.spec ++++++ --- /var/tmp/diff_new_pack.o24281/_old 2007-09-13 18:36:03.000000000 +0200 +++ /var/tmp/diff_new_pack.o24281/_new 2007-09-13 18:36:03.000000000 +0200 @@ -19,7 +19,7 @@ Group: Development/Tools/Other Autoreqprov: on Version: 0.16 -Release: 38 +Release: 44 Summary: Tools for Native Language Support (NLS) PreReq: %{install_info_prereq} BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,9 +34,9 @@ Patch5: gettext-initialize_vars.patch Patch6: gettext-0.15-docdir.diff Patch7: gettext-autotools.patch -Patch8: gettext-expat_check.patch -Patch9: bug287150-ycp-comments.diff +Patch9: gettext-bug287150-ycp-comments.patch Patch10: fixes-from-gettext-0.16.1.diff +Patch11: gettext-expat_dynload_fix.patch %description This package contains the intl library as well as tools that ease the @@ -83,9 +83,9 @@ %patch5 %patch6 -p1 %patch7 -%patch8 -%patch9 -p1 +%patch9 %patch10 -p1 +%patch11 rename no nb gettext-tools/po/no.* rename no nb gettext-runtime/po/no.* pushd gettext-tools/misc @@ -93,11 +93,10 @@ find . -name gettext.m4,v -print0 | xargs -0 perl -spi -e 's/\(int\) /\(long\) /g' tar cfz archive.tar.gz archive/ popd -# expect a couple "You should update your `aclocal.m4' by running aclocal." -autoreconf -fiv %build -#sh autogen.sh +# expect a couple "You should update your `aclocal.m4' by running aclocal." +autoreconf -fiv export CFLAGS="$RPM_OPT_FLAGS -pipe -W -Wall" export CXXFLAGS="$CFLAGS" %configure --enable-shared @@ -244,6 +243,9 @@ %_prefix/share/aclocal/* %changelog +* Mon Sep 03 2007 - pth@suse.de +- Incorporate upstream patch that correctly fixes the expat + dynloading code (http://savannah.gnu.org/bugs/?19585). * Wed Aug 15 2007 - coolo@suse.de - do not set the version to 0.16.1 * Thu Aug 09 2007 - bk@suse.de ++++++ gettext-bug287150-ycp-comments.patch ++++++ --- gettext-tools/src/x-ycp.c 2006-11-27 18:02:08.000000000 +0100 +++ gettext-tools/src/x-ycp.c 2007-06-25 11:14:49.000000000 +0200 @@ -1,5 +1,5 @@ /* xgettext YCP backend. - Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007 Free Software Foundation, Inc. This file was written by Bruno Haible <haible@clisp.cons.org>, 2001. @@ -21,6 +21,9 @@ # include "config.h" #endif +/* Specification. */ +#include "x-ycp.h" + #include <errno.h> #include <limits.h> #include <stdbool.h> @@ -32,7 +35,6 @@ #include "x-ycp.h" #include "error.h" #include "xalloc.h" -#include "exit.h" #include "gettext.h" #define _(s) gettext(s) @@ -327,6 +329,7 @@ { token_type_ty type; char *string; /* for token_type_string_literal, token_type_symbol */ + refcounted_string_list_ty *comment; /* for token_type_string_literal */ int line_number; }; @@ -403,6 +406,17 @@ } +/* Free the memory pointed to by a 'struct token_ty'. */ +static inline void +free_token (token_ty *tp) +{ + if (tp->type == token_type_string_literal || tp->type == token_type_symbol) + free (tp->string); + if (tp->type == token_type_string_literal) + drop_reference (tp->comment); +} + + /* Combine characters into tokens. Discard whitespace. */ static token_ty phase5_pushback[1]; @@ -530,6 +544,7 @@ buffer[bufpos] = '\0'; tp->string = xstrdup (buffer); tp->type = token_type_string_literal; + tp->comment = add_reference (savable_comment); return; case '(': @@ -590,7 +605,7 @@ len = strlen (tp->string); tp->string = xrealloc (tp->string, len + strlen (tmp.string) + 1); strcpy (tp->string + len, tmp.string); - free (tmp.string); + free_token (&tmp); } } @@ -670,7 +685,7 @@ /* Seen an msgid. */ plural_mp = remember_a_message (mlp, NULL, token.string, inner_context, &pos, - savable_comment); + token.comment); state = 2; } else @@ -678,13 +693,14 @@ /* Seen an msgid_plural. */ remember_a_message_plural (plural_mp, token.string, inner_context, &pos, - savable_comment); + token.comment); state = 0; } + drop_reference (token.comment); } else { - free (token.string); + free_token (&token); state = 0; } next_context_iter = null_context_list_iterator; @@ -696,7 +712,7 @@ flag_context_list_table_lookup ( flag_context_list_table, token.string, strlen (token.string))); - free (token.string); + free_token (&token); state = 0; continue; --- gettext-tools/src/x-ycp.h 2006-11-27 18:02:08.000000000 +0100 +++ gettext-tools/src/x-ycp.h 2006-10-30 13:31:40.000000000 +0100 @@ -1,5 +1,5 @@ /* xgettext YCP backend. - Copyright (C) 2001-2003 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software; you can redistribute it and/or modify @@ -17,6 +17,17 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include <stdio.h> + +#include "message.h" +#include "xgettext.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + #define EXTENSIONS_YCP \ { "ycp", "YCP" }, \ @@ -31,3 +42,8 @@ msgdomain_list_ty *mdlp); extern void init_flag_table_ycp (void); + + +#ifdef __cplusplus +} +#endif ++++++ gettext-expat_dynload_fix.patch ++++++ --- gettext-tools/src/x-glade.c +++ gettext-tools/src/x-glade.c @@ -1,5 +1,5 @@ /* xgettext glade backend. - Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. This file was written by Bruno Haible <haible@clisp.cons.org>, 2002. @@ -21,9 +21,11 @@ # include "config.h" #endif + #include <errno.h> #include <stdbool.h> #include <stdio.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #if DYNLOAD_LIBEXPAT @@ -36,6 +38,7 @@ #include "message.h" #include "xgettext.h" +/* Specification. */ #include "x-glade.h" #include "error.h" #include "xerror.h" @@ -43,7 +46,6 @@ #include "basename.h" #include "progname.h" #include "xalloc.h" -#include "exit.h" #include "hash.h" #include "po-charset.h" #include "gettext.h" @@ -107,10 +109,103 @@ } +/* ======================= Different libexpat ABIs. ======================= */ + +/* There are three different ABIs of libexpat, regarding the functions + XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber. + In expat < 2.0, they return an 'int'. + In expat >= 2.0, they return + - a 'long' if expat was compiled with the default flags, or + - a 'long long' if expat was compiled with -DXML_LARGE_SIZE. + But the <expat.h> include file does not contain the information whether + expat was compiled with -DXML_LARGE_SIZE; so the include file is lying! + For this information, we need to call XML_GetFeatureList(), for + expat >= 2.0.1; for expat = 2.0.0, we have to assume the default flags. */ + +#if !DYNLOAD_LIBEXPAT + +# if XML_MAJOR_VERSION >= 2 + +/* expat >= 2.0 -> Return type is 'int64_t' worst-case. */ + +/* Put the function pointers into variables, because some GCC 4 versions + generate an abort when we convert symbol address to different function + pointer types. */ +static void *p_XML_GetCurrentLineNumber = (void *) &XML_GetCurrentLineNumber; +static void *p_XML_GetCurrentColumnNumber = (void *) &XML_GetCurrentColumnNumber; + +/* Return true if libexpat was compiled with -DXML_LARGE_SIZE. */ +static bool +is_XML_LARGE_SIZE_ABI (void) +{ + static bool tested; + static bool is_large; + + if (!tested) + { + const XML_Feature *features; + + is_large = false; + for (features = XML_GetFeatureList (); features->name != NULL; features++) + if (strcmp (features->name, "XML_LARGE_SIZE") == 0) + { + is_large = true; + break; + } + + tested = true; + } + return is_large; +} + +static int64_t +GetCurrentLineNumber (XML_Parser parser) +{ + if (is_XML_LARGE_SIZE_ABI ()) + return ((int64_t (*) (XML_Parser)) p_XML_GetCurrentLineNumber) (parser); + else + return ((long (*) (XML_Parser)) p_XML_GetCurrentLineNumber) (parser); +} +# define XML_GetCurrentLineNumber GetCurrentLineNumber + +static int64_t +GetCurrentColumnNumber (XML_Parser parser) +{ + if (is_XML_LARGE_SIZE_ABI ()) + return ((int64_t (*) (XML_Parser)) p_XML_GetCurrentColumnNumber) (parser); + else + return ((long (*) (XML_Parser)) p_XML_GetCurrentColumnNumber) (parser); +} +# define XML_GetCurrentColumnNumber GetCurrentColumnNumber + +# else + +/* expat < 2.0 -> Return type is 'int'. */ + +# endif + +#endif + + /* ===================== Dynamic loading of libexpat. ===================== */ #if DYNLOAD_LIBEXPAT +typedef struct + { + int major; + int minor; + int micro; + } + XML_Expat_Version; +enum XML_FeatureEnum { XML_FEATURE_END = 0 }; +typedef struct + { + enum XML_FeatureEnum feature; + const char *name; + long int value; + } + XML_Feature; typedef void *XML_Parser; typedef char XML_Char; typedef char XML_LChar; @@ -120,30 +215,94 @@ typedef void (*XML_CharacterDataHandler) (void *userData, const XML_Char *s, int len); typedef void (*XML_CommentHandler) (void *userData, const XML_Char *data); +static XML_Expat_Version (*p_XML_ExpatVersionInfo) (void); +static const XML_Feature * (*p_XML_GetFeatureList) (void); static XML_Parser (*p_XML_ParserCreate) (const XML_Char *encoding); static void (*p_XML_SetElementHandler) (XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); static void (*p_XML_SetCharacterDataHandler) (XML_Parser parser, XML_CharacterDataHandler handler); static void (*p_XML_SetCommentHandler) (XML_Parser parser, XML_CommentHandler handler); static int (*p_XML_Parse) (XML_Parser parser, const char *s, int len, int isFinal); static enum XML_Error (*p_XML_GetErrorCode) (XML_Parser parser); -#if XML_MAJOR_VERSION >= 2 -static XML_Size (*p_XML_GetCurrentLineNumber) (XML_Parser parser); -static XML_Size (*p_XML_GetCurrentColumnNumber) (XML_Parser parser); -#else -static int (*p_XML_GetCurrentLineNumber) (XML_Parser parser); -static int (*p_XML_GetCurrentColumnNumber) (XML_Parser parser); -#endif +static void *p_XML_GetCurrentLineNumber; +static void *p_XML_GetCurrentColumnNumber; static void (*p_XML_ParserFree) (XML_Parser parser); static const XML_LChar * (*p_XML_ErrorString) (int code); +#define XML_ExpatVersionInfo (*p_XML_ExpatVersionInfo) +#define XML_GetFeatureList (*p_XML_GetFeatureList) + +enum XML_Size_ABI { is_int, is_long, is_int64_t }; + +static enum XML_Size_ABI +get_XML_Size_ABI (void) +{ + static bool tested; + static enum XML_Size_ABI abi; + + if (!tested) + { + if (XML_ExpatVersionInfo () .major >= 2) + /* expat >= 2.0 -> XML_Size is 'int64_t' or 'long'. */ + { + const XML_Feature *features; + + abi = is_long; + for (features = XML_GetFeatureList (); + features->name != NULL; + features++) + if (strcmp (features->name, "XML_LARGE_SIZE") == 0) + { + abi = is_int64_t; + break; + } + } + else + /* expat < 2.0 -> XML_Size is 'int'. */ + abi = is_int; + tested = true; + } + return abi; +} + #define XML_ParserCreate (*p_XML_ParserCreate) #define XML_SetElementHandler (*p_XML_SetElementHandler) #define XML_SetCharacterDataHandler (*p_XML_SetCharacterDataHandler) #define XML_SetCommentHandler (*p_XML_SetCommentHandler) #define XML_Parse (*p_XML_Parse) #define XML_GetErrorCode (*p_XML_GetErrorCode) -#define XML_GetCurrentLineNumber (*p_XML_GetCurrentLineNumber) -#define XML_GetCurrentColumnNumber (*p_XML_GetCurrentColumnNumber) + +static int64_t +XML_GetCurrentLineNumber (XML_Parser parser) +{ + switch (get_XML_Size_ABI ()) + { + case is_int: + return ((int (*) (XML_Parser)) p_XML_GetCurrentLineNumber) (parser); + case is_long: + return ((long (*) (XML_Parser)) p_XML_GetCurrentLineNumber) (parser); + case is_int64_t: + return ((int64_t (*) (XML_Parser)) p_XML_GetCurrentLineNumber) (parser); + default: + abort (); + } +} + +static int64_t +XML_GetCurrentColumnNumber (XML_Parser parser) +{ + switch (get_XML_Size_ABI ()) + { + case is_int: + return ((int (*) (XML_Parser)) p_XML_GetCurrentColumnNumber) (parser); + case is_long: + return ((long (*) (XML_Parser)) p_XML_GetCurrentColumnNumber) (parser); + case is_int64_t: + return ((int64_t (*) (XML_Parser)) p_XML_GetCurrentColumnNumber) (parser); + default: + abort (); + } +} + #define XML_ParserFree (*p_XML_ParserFree) #define XML_ErrorString (*p_XML_ErrorString) @@ -155,24 +314,47 @@ if (libexpat_loaded == 0) { void *handle; - /* Be careful to use exactly the version of libexpat that matches the - binary interface declared in <expat.h>. */ -#if XML_MAJOR_VERSION >= 2 + + /* Try to load libexpat-2.x. */ handle = dlopen ("libexpat.so.1", RTLD_LAZY); -#else - handle = dlopen ("libexpat.so.0", RTLD_LAZY); -#endif + if (handle == NULL) + /* Try to load libexpat-1.x. */ + handle = dlopen ("libexpat.so.0", RTLD_LAZY); if (handle != NULL - && (p_XML_ParserCreate = dlsym (handle, "XML_ParserCreate")) != NULL - && (p_XML_SetElementHandler = dlsym (handle, "XML_SetElementHandler")) != NULL - && (p_XML_SetCharacterDataHandler = dlsym (handle, "XML_SetCharacterDataHandler")) != NULL - && (p_XML_SetCommentHandler = dlsym (handle, "XML_SetCommentHandler")) != NULL - && (p_XML_Parse = dlsym (handle, "XML_Parse")) != NULL - && (p_XML_GetErrorCode = dlsym (handle, "XML_GetErrorCode")) != NULL - && (p_XML_GetCurrentLineNumber = dlsym (handle, "XML_GetCurrentLineNumber")) != NULL - && (p_XML_GetCurrentColumnNumber = dlsym (handle, "XML_GetCurrentColumnNumber")) != NULL - && (p_XML_ParserFree = dlsym (handle, "XML_ParserFree")) != NULL - && (p_XML_ErrorString = dlsym (handle, "XML_ErrorString")) != NULL) + && (p_XML_ExpatVersionInfo = + (XML_Expat_Version (*) (void)) + dlsym (handle, "XML_ExpatVersionInfo")) != NULL + && (p_XML_GetFeatureList = + (const XML_Feature * (*) (void)) + dlsym (handle, "XML_GetFeatureList")) != NULL + && (p_XML_ParserCreate = + (XML_Parser (*) (const XML_Char *)) + dlsym (handle, "XML_ParserCreate")) != NULL + && (p_XML_SetElementHandler = + (void (*) (XML_Parser, XML_StartElementHandler, XML_EndElementHandler)) + dlsym (handle, "XML_SetElementHandler")) != NULL + && (p_XML_SetCharacterDataHandler = + (void (*) (XML_Parser, XML_CharacterDataHandler)) + dlsym (handle, "XML_SetCharacterDataHandler")) != NULL + && (p_XML_SetCommentHandler = + (void (*) (XML_Parser, XML_CommentHandler)) + dlsym (handle, "XML_SetCommentHandler")) != NULL + && (p_XML_Parse = + (int (*) (XML_Parser, const char *, int, int)) + dlsym (handle, "XML_Parse")) != NULL + && (p_XML_GetErrorCode = + (enum XML_Error (*) (XML_Parser)) + dlsym (handle, "XML_GetErrorCode")) != NULL + && (p_XML_GetCurrentLineNumber = + dlsym (handle, "XML_GetCurrentLineNumber")) != NULL + && (p_XML_GetCurrentColumnNumber = + dlsym (handle, "XML_GetCurrentColumnNumber")) != NULL + && (p_XML_ParserFree = + (void (*) (XML_Parser)) + dlsym (handle, "XML_ParserFree")) != NULL + && (p_XML_ErrorString = + (const XML_LChar * (*) (int)) + dlsym (handle, "XML_ErrorString")) != NULL) libexpat_loaded = 1; else libexpat_loaded = -1; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de