diff --git a/glib-2.27.91.tar.bz2 b/glib-2.27.91.tar.bz2 deleted file mode 100644 index bc88260..0000000 --- a/glib-2.27.91.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9786cedb66b4913caac2297550277b6585da7f9f30ade5717725b5262fb5cbeb -size 6934447 diff --git a/glib-2.27.92.tar.bz2 b/glib-2.27.92.tar.bz2 new file mode 100644 index 0000000..401fb4a --- /dev/null +++ b/glib-2.27.92.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb8230a152899474cc285bb9776d77ad64a8660977a159688e8caf1d277ec510 +size 6994516 diff --git a/glib2-force-fam-for-remote-fs.patch b/glib2-force-fam-for-remote-fs.patch new file mode 100644 index 0000000..25e7d1e --- /dev/null +++ b/glib2-force-fam-for-remote-fs.patch @@ -0,0 +1,284 @@ +diff --git a/gio/glocaldirectorymonitor.c b/gio/glocaldirectorymonitor.c +index 6aea9a0..49b2084 100644 +--- a/gio/glocaldirectorymonitor.c ++++ b/gio/glocaldirectorymonitor.c +@@ -266,26 +266,78 @@ get_default_local_directory_monitor (gpointer data) + return (gpointer)G_TYPE_INVALID; + } + ++static gpointer ++get_default_remote_directory_monitor (gpointer data) ++{ ++ GLocalDirectoryMonitorClass *chosen_class = NULL; ++ GLocalDirectoryMonitorClass **ret = data; ++ GIOExtensionPoint *ep; ++ GIOExtension *extension; ++ GLocalDirectoryMonitorClass *klass; ++ ++ _g_io_modules_ensure_loaded (); ++ ++ ep = g_io_extension_point_lookup (G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME); ++ ++ extension = g_io_extension_point_get_extension_by_name (ep, "fam"); ++ if (!extension) ++ return (gpointer)G_TYPE_INVALID; ++ ++ klass = G_LOCAL_DIRECTORY_MONITOR_CLASS (g_io_extension_ref_class (extension)); ++ ++ if (klass->is_supported ()) ++ chosen_class = klass; ++ else ++ g_type_class_unref (klass); ++ ++ if (chosen_class) ++ { ++ *ret = chosen_class; ++ return (gpointer)G_TYPE_FROM_CLASS (chosen_class); ++ } ++ else ++ return (gpointer)G_TYPE_INVALID; ++} ++ + GFileMonitor* + _g_local_directory_monitor_new (const char *dirname, + GFileMonitorFlags flags, ++ gboolean is_remote_fs, + GError **error) + { +- static GOnce once_init = G_ONCE_INIT; + GTypeClass *type_class; + GFileMonitor *monitor; + GType type; + + type_class = NULL; +- g_once (&once_init, get_default_local_directory_monitor, &type_class); +- type = (GType)once_init.retval; +- + monitor = NULL; ++ ++ if (is_remote_fs) ++ { ++ static GOnce once_init = G_ONCE_INIT; ++ ++ g_once (&once_init, get_default_remote_directory_monitor, &type_class); ++ type = (GType)once_init.retval; ++ } ++ else ++ { ++ static GOnce once_init = G_ONCE_INIT; ++ ++ g_once (&once_init, get_default_local_directory_monitor, &type_class); ++ type = (GType)once_init.retval; ++ } ++ + if (type != G_TYPE_INVALID) + monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, "flags", flags, NULL)); +- else +- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, +- _("Unable to find default local directory monitor type")); ++ ++ if (!monitor) ++ { ++ if (is_remote_fs) ++ monitor = _g_local_directory_monitor_new (dirname, flags, FALSE, error); ++ else ++ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ _("Unable to find default local directory monitor type")); ++ } + + /* This is non-null on first pass here. Unref the class now. + * This is to avoid unloading the module and then loading it +diff --git a/gio/glocaldirectorymonitor.h b/gio/glocaldirectorymonitor.h +index 418634e..b0a0d5a 100644 +--- a/gio/glocaldirectorymonitor.h ++++ b/gio/glocaldirectorymonitor.h +@@ -64,6 +64,7 @@ GType g_local_directory_monitor_get_type (void) G_GNUC_CONST; + + GFileMonitor * _g_local_directory_monitor_new (const char *dirname, + GFileMonitorFlags flags, ++ gboolean is_remote_fs, + GError **error); + + G_END_DECLS +diff --git a/gio/glocalfile.c b/gio/glocalfile.c +index ec290e7..d8661ba 100644 +--- a/gio/glocalfile.c ++++ b/gio/glocalfile.c +@@ -2344,6 +2344,57 @@ g_local_file_move (GFile *source, + return TRUE; + } + ++static gboolean ++is_remote_fs (GLocalFile *local) ++{ ++ const char *fsname; ++ ++ fsname = NULL; ++ ++#ifdef USE_STATFS ++ struct statfs statfs_buffer; ++ int statfs_result = 0; ++ ++#if STATFS_ARGS == 2 ++ statfs_result = statfs (local->filename, &statfs_buffer); ++#elif STATFS_ARGS == 4 ++ statfs_result = statfs (local->filename, &statfs_buffer, ++ sizeof (statfs_buffer), 0); ++#endif ++ ++#elif defined(USE_STATVFS) ++ struct statvfs statfs_buffer; ++ ++ statfs_result = statvfs (local->filename, &statfs_buffer); ++#else ++ return FALSE; ++#endif ++ ++ if (statfs_result == -1) ++ return FALSE; ++ ++#ifdef USE_STATFS ++#if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) ++ fsname = statfs_buffer.f_fstypename; ++#else ++ fsname = get_fs_type (statfs_buffer.f_type); ++#endif ++ ++#elif defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_BASETYPE) ++ fsname = statfs_buffer.f_basetype; ++#endif ++ ++ if (fsname != NULL) ++ { ++ if (strcmp (fsname, "nfs") == 0) ++ return TRUE; ++ if (strcmp (fsname, "nfs4") == 0) ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ + static GFileMonitor* + g_local_file_monitor_dir (GFile *file, + GFileMonitorFlags flags, +@@ -2351,7 +2402,7 @@ g_local_file_monitor_dir (GFile *file, + GError **error) + { + GLocalFile* local_file = G_LOCAL_FILE(file); +- return _g_local_directory_monitor_new (local_file->filename, flags, error); ++ return _g_local_directory_monitor_new (local_file->filename, flags, is_remote_fs (local_file), error); + } + + static GFileMonitor* +@@ -2361,7 +2412,7 @@ g_local_file_monitor_file (GFile *file, + GError **error) + { + GLocalFile* local_file = G_LOCAL_FILE(file); +- return _g_local_file_monitor_new (local_file->filename, flags, error); ++ return _g_local_file_monitor_new (local_file->filename, flags, is_remote_fs (local_file), error); + } + + static void +diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c +index 8405d3a..5fc2163 100644 +--- a/gio/glocalfilemonitor.c ++++ b/gio/glocalfilemonitor.c +@@ -191,26 +191,78 @@ get_default_local_file_monitor (gpointer data) + return (gpointer)G_TYPE_INVALID; + } + ++static gpointer ++get_default_remote_file_monitor (gpointer data) ++{ ++ GLocalFileMonitorClass *chosen_class = NULL; ++ GLocalFileMonitorClass **ret = data; ++ GIOExtensionPoint *ep; ++ GIOExtension *extension; ++ GLocalFileMonitorClass *klass; ++ ++ _g_io_modules_ensure_loaded (); ++ ++ ep = g_io_extension_point_lookup (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME); ++ ++ extension = g_io_extension_point_get_extension_by_name (ep, "fam"); ++ if (!extension) ++ return (gpointer)G_TYPE_INVALID; ++ ++ klass = G_LOCAL_FILE_MONITOR_CLASS (g_io_extension_ref_class (extension)); ++ ++ if (klass->is_supported ()) ++ chosen_class = klass; ++ else ++ g_type_class_unref (klass); ++ ++ if (chosen_class) ++ { ++ *ret = chosen_class; ++ return (gpointer)G_TYPE_FROM_CLASS (chosen_class); ++ } ++ else ++ return (gpointer)G_TYPE_INVALID; ++} ++ + GFileMonitor* + _g_local_file_monitor_new (const char *pathname, + GFileMonitorFlags flags, ++ gboolean is_remote_fs, + GError **error) + { +- static GOnce once_init = G_ONCE_INIT; + GTypeClass *type_class; + GFileMonitor *monitor; + GType type; + + type_class = NULL; +- g_once (&once_init, get_default_local_file_monitor, &type_class); +- type = (GType)once_init.retval; +- + monitor = NULL; ++ ++ if (is_remote_fs) ++ { ++ static GOnce once_init = G_ONCE_INIT; ++ ++ g_once (&once_init, get_default_remote_file_monitor, &type_class); ++ type = (GType)once_init.retval; ++ } ++ else ++ { ++ static GOnce once_init = G_ONCE_INIT; ++ ++ g_once (&once_init, get_default_local_file_monitor, &type_class); ++ type = (GType)once_init.retval; ++ } ++ + if (type != G_TYPE_INVALID) + monitor = G_FILE_MONITOR (g_object_new (type, "filename", pathname, "flags", flags, NULL)); +- else +- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, +- _("Unable to find default local file monitor type")); ++ ++ if (!monitor) ++ { ++ if (is_remote_fs) ++ monitor = _g_local_file_monitor_new (pathname, flags, FALSE, error); ++ else ++ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ _("Unable to find default local file monitor type")); ++ } + + /* This is non-null on first pass here. Unref the class now. + * This is to avoid unloading the module and then loading it +diff --git a/gio/glocalfilemonitor.h b/gio/glocalfilemonitor.h +index 6643866..dff3d81 100644 +--- a/gio/glocalfilemonitor.h ++++ b/gio/glocalfilemonitor.h +@@ -57,6 +57,7 @@ GType g_local_file_monitor_get_type (void) G_GNUC_CONST; + + GFileMonitor * _g_local_file_monitor_new (const char *pathname, + GFileMonitorFlags flags, ++ gboolean is_remote_fs, + GError **error); + + G_END_DECLS diff --git a/glib2-use-old-pcre.patch b/glib2-use-old-pcre.patch new file mode 100644 index 0000000..d7fdcb7 --- /dev/null +++ b/glib2-use-old-pcre.patch @@ -0,0 +1,94 @@ +commit c03dc6bf7dfc6e326e7249e9e377676db885d99e +Author: Matthias Clasen +Date: Fri Jan 21 23:10:01 2011 -0500 + + Update the included copy of PCRE + + Update PCRE to version 8.12. + At the same time, also add Unicode 6.0 script support. + +diff --git a/glib/gregex.c b/glib/gregex.c +index b62bda7..a1d2315 100644 +--- a/glib/gregex.c ++++ b/glib/gregex.c +@@ -230,6 +230,10 @@ match_error (gint errcode) + return _("workspace limit for empty substrings reached"); + case PCRE_ERROR_BADNEWLINE: + return _("invalid combination of newline flags"); ++ case PCRE_ERROR_BADOFFSET: ++ return _("bad offset"); ++ case PCRE_ERROR_SHORTUTF8: ++ return _("short utf8"); + default: + break; + } +@@ -565,6 +569,14 @@ g_match_info_next (GMatchInfo *match_info, + prev_match_start = match_info->offsets[0]; + prev_match_end = match_info->offsets[1]; + ++ if (match_info->pos > match_info->string_len) ++ { ++ /* we have reached the end of the string */ ++ match_info->pos = -1; ++ match_info->matches = PCRE_ERROR_NOMATCH; ++ return FALSE; ++ } ++ + match_info->matches = pcre_exec (match_info->regex->pcre_re, + match_info->regex->extra, + match_info->string, +@@ -1197,6 +1209,8 @@ g_regex_new (const gchar *pattern, + compile_options |= PCRE_NEWLINE_ANY; + } + ++ compile_options |= PCRE_UCP; ++ + /* compile the pattern */ + re = pcre_compile2 (pattern, compile_options, &errcode, + &errmsg, &erroffset, NULL); +@@ -1792,6 +1806,7 @@ g_regex_split_simple (const gchar *pattern, + regex = g_regex_new (pattern, compile_options, 0, NULL); + if (!regex) + return NULL; ++ + result = g_regex_split_full (regex, string, -1, 0, match_options, 0, NULL); + g_regex_unref (regex); + return result; +@@ -1924,6 +1939,7 @@ g_regex_split_full (const GRegex *regex, + + match_ok = g_regex_match_full (regex, string, string_len, start_position, + match_options, &match_info, &tmp_error); ++ + while (tmp_error == NULL) + { + if (match_ok) +diff --git a/glib/tests/regex.c b/glib/tests/regex.c +index 6e015e9..ef3ac68 100644 +--- a/glib/tests/regex.c ++++ b/glib/tests/regex.c +@@ -1342,6 +1342,7 @@ test_match_all (gconstpointer d) + #define PCRE_UTF8 0x00000800 + #define PCRE_NO_UTF8_CHECK 0x00002000 + #define PCRE_NEWLINE_ANY 0x00400000 ++#define PCRE_UCP 0x20000000 + + static void + test_basic (void) +@@ -1353,7 +1354,7 @@ test_basic (void) + regex = g_regex_new ("[A-Z]+", cflags, mflags, NULL); + + g_assert (regex != NULL); +- g_assert_cmpint (g_regex_get_compile_flags (regex), ==, cflags|PCRE_UTF8|PCRE_NO_UTF8_CHECK|PCRE_NEWLINE_ANY ); ++ g_assert_cmpint (g_regex_get_compile_flags (regex), ==, cflags|PCRE_UTF8|PCRE_NO_UTF8_CHECK|PCRE_NEWLINE_ANY|PCRE_UCP ); + g_assert_cmpint (g_regex_get_match_flags (regex), ==, mflags|PCRE_NO_UTF8_CHECK); + + g_regex_unref (regex); +@@ -2063,8 +2064,6 @@ main (int argc, char *argv[]) + { + setlocale (LC_ALL, ""); + +- g_setenv ("G_DEBUG", "fatal_warnings", TRUE); +- + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/regex/basic", test_basic); diff --git a/glib2.changes b/glib2.changes index f77ad27..c261f8d 100644 --- a/glib2.changes +++ b/glib2.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Thu Jan 27 10:11:56 CET 2011 - vuntz@opensuse.org + +- Update to version 2.27.92: + + Update to Unicode 6.0 + + Update PCRE to 8.12 + + Bugs fixed: bgo#637696, bgo#638872, bgo#640042. + + Updated translations. +- Add glib2-use-old-pcre.patch: we don't have a recent-enough + version of pcre, so revert the patch doing the update. We apply + the patch on 11.4 and earlier: when the next development cycle + opens, we won't need it anymore. + +------------------------------------------------------------------- +Mon Jan 24 17:06:56 CET 2011 - hpj@novell.com + +- Add glib2-force-fam-for-remote-fs.patch: try monitoring files on + NFS mounts via FAM before falling back to inotify (bgo#592211). + The patch has been submitted upstream and is not yet in git, but + we do want it since it fixes a really annoying issue for NFS + users. + ------------------------------------------------------------------- Fri Jan 14 10:36:01 CET 2011 - vuntz@opensuse.org diff --git a/glib2.spec b/glib2.spec index 31dd8ab..577c058 100644 --- a/glib2.spec +++ b/glib2.spec @@ -21,7 +21,7 @@ Name: glib2 %define _name glib -Version: 2.27.91 +Version: 2.27.92 Release: 1 # FIXME: change zlib-devel to pkgconfig(zlib) once we have a recent enough version of zlib # FIXME: find out if tapsets should really be in devel package or in main package @@ -40,12 +40,16 @@ Source5: macros.glib2 # Please update this file from the latest gtk-doc package: Source6: gtk-doc.m4 Source99: baselibs.conf +# PATCH-FIX-OPENSUSE glib2-use-old-pcre.patch vuntz@opensuse.org -- Do no require a too recent version of pcre on openSUSE versions that don't have it +Patch0: glib2-use-old-pcre.patch # PATCH-FIX-OPENSUSE glib2-bnc379332-desktop-su.patch bnc379332 vuntz@novell.com -- Use X-KDE-SubstituteUID Patch8: glib2-bnc379332-desktop-su.patch # PATCH-FEATURE-UPSTREAM glib2-bgo569829-gettext-gkeyfile.patch fate300461 bgo569829 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that we share with Ubuntu and try to push upstream Patch10: glib2-bgo569829-gettext-gkeyfile.patch # PATCH-FEATURE-OPENSUSE glib2-fate300461-gettext-gkeyfile-suse.patch fate300461 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that deals with the openSUSE specific infrastructure (with desktop_translations) Patch11: glib2-fate300461-gettext-gkeyfile-suse.patch +# PATCH-FIX-UPSTREAM glib2-force-fam-for-remote-fs.patch bgo#592211 hpj@novell.com -- Try monitoring files on NFS mounts via FAM before falling back to inotify. +Patch12: glib2-force-fam-for-remote-fs.patch BuildRequires: fam-devel BuildRequires: fdupes BuildRequires: gcc-c++ @@ -245,9 +249,13 @@ The GObject library provides an object-oriented framework for C. %prep %setup -q -n %{_name}-%{version} translation-update-upstream +%if 0%{?suse_version} <= 1140 +%patch0 -p1 -R +%endif %patch8 %patch10 -p1 %patch11 -p1 +%patch12 -p1 cp -a %{S:1} %{S:2} %{S:3} . cp -a %{S:4} gnome_defaults.conf if ! test -f %{_datadir}/aclocal/gtk-doc.m4 ; then