Hello community,
here is the log from the commit of package libgda
checked in at Sat Oct 13 00:11:36 CEST 2007.
--------
--- GNOME/libgda/libgda.changes 2007-08-08 00:01:37.000000000 +0200
+++ /mounts/work_src_done/STABLE/libgda/libgda.changes 2007-10-12 15:22:11.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Oct 3 17:11:33 CEST 2007 - sbrabec@suse.cz
+
+- Updated to version 3.1.1:
+ * New major version, new API. See NEWS for details.
+
+-------------------------------------------------------------------
Old:
----
libgda-1.3.91.tar.bz2
libgda-boxed.patch
libgda-include.patch
libgda-syslog-vul.patch
New:
----
libgda-3.1.1.tar.bz2
libgda-implicit-decl.patch
libgda-uninitialized.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libgda.spec ++++++
--- /var/tmp/diff_new_pack.y23567/_old 2007-10-13 00:11:07.000000000 +0200
+++ /var/tmp/diff_new_pack.y23567/_new 2007-10-13 00:11:07.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package libgda (Version 1.3.91)
+# spec file for package libgda (Version 3.1.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,21 +12,19 @@
Name: libgda
BuildRequires: db-devel fdupes gcc-c++ glib2-devel gnome-common gnome-vfs2-devel gtk-doc intltool libxslt-devel mysql mysql-devel openldap2 openldap2-devel perl-XML-Parser popt-devel postgresql-devel readline-devel scrollkeeper sgml-skel sqlite-devel unixODBC-devel
-License: GPL v2 or later, LGPL v2 or later
+License: GPL v2 or later; LGPL v2 or later
Group: Productivity/Databases/Servers
-Autoreqprov: on
-Version: 1.3.91
-Release: 124
+Version: 3.1.1
+Release: 1
Summary: GNU Data Access (GDA) Library
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-URL: http://www.gnome-db.org/
-Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/1.3/%{name}-%{version}.tar.bz2
+Url: http://www.gnome-db.org/
+Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/3.1/%{name}-%{version}.tar.bz2
Patch: libgda-1.0.3-ncurses.patch
Patch1: libgda-1.0.3-lib64.patch
Patch2: libgda-vfsmonitor.patch
-Patch3: libgda-syslog-vul.patch
-Patch4: libgda-include.patch
-Patch5: libgda-boxed.patch
+Patch3: libgda-uninitialized.patch
+Patch4: libgda-implicit-decl.patch
Requires: %{name}-lang = %{version}
%description
@@ -244,20 +242,21 @@
%lang_package
%prep
-%setup
+%setup -q
%patch
%patch1
%patch2
%patch3
%patch4
-%patch5
%build
rm po/no.*
sed -i "s/\(ALL_LINGUAS.*\) no /\1 /" configure.in
autoreconf -f -i
-# both flags needed for libgda-1.3.91:
-export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED"
+# both flags needed for libgda-3.1.1:
+#export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED"
+# needed for libgda-3.1.1:
+export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# FIXME: Build as root modifies system!
# libgda-1.3.91: --disable-scrollkeeper does not work properly.
%configure\
@@ -266,39 +265,34 @@
make %{?jobs:-j%jobs}
%install
-make install DESTDIR=$RPM_BUILD_ROOT
-%find_lang libgda-3
-rm $RPM_BUILD_ROOT%{_libdir}/libgda-1.3/providers/*.*a
-
+%makeinstall
+%find_lang libgda-3.0
+rm $RPM_BUILD_ROOT%{_libdir}/libgda-3.0/providers/*.*a
%fdupes $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
-%postun
-/sbin/ldconfig
+%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README
-%{_datadir}/libgda
-%{_datadir}/omf/*
+%{_datadir}/libgda-3.0
%{_bindir}/*
%{_libdir}/*.so.*
-%dir %{_libdir}/libgda-1.3
-%dir %{_libdir}/libgda-1.3/providers
-%{_libdir}/libgda-1.3/providers/libgda-ldap.so
-%{_libdir}/libgda-1.3/providers/libgda-xml.so
-%{_libdir}/libgda-1.3/providers/libgda-bdb.so
+%dir %{_libdir}/libgda-3.0
+%dir %{_libdir}/libgda-3.0/providers
+%{_libdir}/libgda-3.0/providers/libgda-ldap.so
+%{_libdir}/libgda-3.0/providers/libgda-bdb.so
%doc %{_mandir}/man?/*.*
-%dir %{_sysconfdir}/libgda
-%config %dir %{_sysconfdir}/libgda/config
-%{_sysconfdir}/libgda/sales_test.db
+%dir %{_sysconfdir}/libgda-3.0
+%config %dir %{_sysconfdir}/libgda-3.0/config
+%{_sysconfdir}/libgda-3.0/sales_test.db
-%files lang -f libgda-3.lang
+%files lang -f libgda-3.0.lang
%files devel
%defattr(-, root, root)
@@ -309,27 +303,27 @@
%files doc
%defattr(-, root, root)
-%{_datadir}/gtk-doc/html/libgda
+%{_datadir}/gtk-doc/html/libgda-3.0
%files mysql
%defattr(-, root, root)
-%{_libdir}/libgda-1.3/providers/libgda-mysql.so
+%{_libdir}/libgda-3.0/providers/libgda-mysql.so
%files odbc
%defattr(-, root, root)
-%{_libdir}/libgda-1.3/providers/libgda-odbc.so
+%{_libdir}/libgda-3.0/providers/libgda-odbc.so
%files postgres
%defattr(-, root, root)
-%{_libdir}/libgda-1.3/providers/libgda-postgres.so
-%if %suse_version > 900
+%{_libdir}/libgda-3.0/providers/libgda-postgres.so
%files sqlite
%defattr(-, root, root)
-%{_libdir}/libgda-1.3/providers/libgda-sqlite.so
-%endif
-
+%{_libdir}/libgda-3.0/providers/libgda-sqlite.so
%changelog
+* Wed Oct 03 2007 - sbrabec@suse.cz
+- Updated to version 3.1.1:
+ * New major version, new API. See NEWS for details.
* Wed Aug 08 2007 - maw@suse.de
- Use %%fdupes
- Split off a -lang subpackage
++++++ libgda-1.0.3-ncurses.patch ++++++
--- /var/tmp/diff_new_pack.y23567/_old 2007-10-13 00:11:08.000000000 +0200
+++ /var/tmp/diff_new_pack.y23567/_new 2007-10-13 00:11:08.000000000 +0200
@@ -1,11 +1,11 @@
--- configure.in
+++ configure.in
-@@ -804,7 +804,7 @@
- dnl ******************************
- dnl Check for readline/history/popt
- dnl ******************************
--AC_CHECK_LIB(readline,readline, READLINE_LIB='-lreadline -lcurses', , -lcurses)
-+AC_CHECK_LIB(readline,readline, READLINE_LIB='-lreadline -lncurses', , -lncurses)
+@@ -1013,7 +1013,7 @@
+ if test x"$platform_win32" = "xyes"; then
+ AC_CHECK_LIB(readline, readline, READLINE_LIB='-lreadline', [])
+ else
+- AC_CHECK_LIB(readline, readline, READLINE_LIB='-lreadline -lcurses', [], -lcurses)
++ AC_CHECK_LIB(readline, readline, READLINE_LIB='-lreadline -lncurses', [], -lncurses)
+ fi
AM_CONDITIONAL(READLINE_LIB, test ! "x$READLINE_LIB" = "x")
AC_SUBST(READLINE_LIB)
-
++++++ libgda-1.3.91.tar.bz2 -> libgda-3.1.1.tar.bz2 ++++++
++++ 699402 lines of diff (skipped)
++++++ libgda-implicit-decl.patch ++++++
http://bugzilla.gnome.org/show_bug.cgi?id=486017
../libsql/lexer.l: In function 'sqllex':
../libsql/lexer.l:111: warning: implicit declaration of function 'sqlerror'
gda-sql-delimiter.c: In function 'gda_delimiter_parse_with_error':
gda-sql-delimiter.c:148: warning: implicit declaration of function 'gda_delimiter_lex_reset'
parser.y: In function 'gda_delimiterparse':
parser.y:103: warning: implicit declaration of function 'gda_delimiter_lex_reset'
lexer.l: In function 'gda_delimiterlex':
lexer.l:126: warning: implicit declaration of function 'gda_delimitererror'
gda-threader.c: In function 'gda_threader_init':
gda-threader.c:128: warning: implicit declaration of function 'getenv'
gda-vprovider-data-model.c: In function 'virtualCreate':
gda-vprovider-data-model.c:360: warning: implicit declaration of function 'gda_data_access_wrapper_new'
gda-odbc-provider.c: In function 'get_odbc_databases':
gda-odbc-provider.c:804: warning: implicit declaration of function 'gda_parameter_list_find_param'
gda-test-models.c: In function 'main':
gda-test-models.c:70: warning: implicit declaration of function 'g_mkdir'
gda-test-models.c: In function 'test_and_destroy_dict':
gda-test-models.c:214: warning: implicit declaration of function 'g_unlink'
gda-test-models.c: In function 'action_append_data':
gda-test-models.c:485: warning: implicit declaration of function 'gda_data_model_add_data_from_xml_node'
================================================================================
--- providers/odbc/gda-odbc-provider.c
+++ providers/odbc/gda-odbc-provider.c
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include "gda-odbc.h"
#include "gda-odbc-provider.h"
--- providers/sqlite/virtual/gda-vprovider-data-model.c
+++ providers/sqlite/virtual/gda-vprovider-data-model.c
@@ -28,6 +28,7 @@
#include "gda-vconnection-data-model-private.h"
#include
#include
+#include
#include
#include
#include
++++++ libgda-uninitialized.patch ++++++
http://bugzilla.gnome.org/show_bug.cgi?id=486017
gda-handler-time.c: In function 'gda_handler_time_get_value_from_locale':
gda-handler-time.c:796: warning: 'buff' may be used uninitialized in this function
gda-data-model-bdb.c: In function 'gda_data_model_bdb_set_values':
gda-data-model-bdb.c:757: warning: 'ptr' is used uninitialized in this function
gda-data-model.c: In function 'gda_data_model_import_from_model':
gda-data-model.c:1677: warning: 'to_nb_rows' may be used uninitialized in this function
gda-dict-database.c: In function 'gda_dict_database_get_field_by_name':
gda-dict-database.c:1363: warning: 'tok' may be used uninitialized in this function
gda-dict.c: In function 'gda_dict_load_xml_file':
gda-dict.c:588: warning: 'node' is used uninitialized in this function
gda-dict-table.c: In function 'gda_dict_table_update_dbms_data':
gda-dict-table.c:808: warning: 'tok' may be used uninitialized in this function
gda-dict-reg-types.c: In function 'types_dbms_sync':
gda-dict-reg-types.c:345: warning: 'buf' may be used uninitialized in this function
gda-object-ref.c: In function 'gda_object_ref_activate':
gda-object-ref.c:833: warning: 'tok' may be used uninitialized in this function
gda-object-ref.c:857: warning: 'tok' may be used uninitialized in this function
gda-object-ref.c:894: warning: 'tok' may be used uninitialized in this function
gda-object-ref.c: In function 'gda_object_ref_set_ref_name':
gda-object-ref.c:520: warning: 'tok' may be used uninitialized in this function
gda-query-field-all.c: In function 'gda_query_field_all_load_from_xml':
gda-query-field-all.c:628: warning: 'tok' may be used uninitialized in this function
gda-query-field-field.c: In function 'gda_query_field_field_render_as_str':
gda-query-field-field.c:1111: warning: 'tname' may be used uninitialized in this function
gda-query-field-field.c: In function 'gda_query_field_field_set_property':
gda-query-field-field.c:463: warning: 'tok' may be used uninitialized in this function
gda-query-field-field.c: In function 'gda_query_field_field_load_from_xml':
gda-query-field-field.c:942: warning: 'tok' may be used uninitialized in this function
gda-query-condition.c: In function 'gda_query_condition_load_from_xml':
gda-query-condition.c:1445: warning: 'tok' may be used uninitialized in this function
gda-query-field-agg.c: In function 'gda_query_field_agg_render_as_str':
gda-query-field-agg.c:975: warning: 'list' is used uninitialized in this function
gda-query-field-agg.c: In function 'gda_query_field_agg_load_from_xml':
gda-query-field-agg.c:755: warning: 'tok' may be used uninitialized in this function
gda-query-field-func.c: In function 'gda_query_field_func_load_from_xml':
gda-query-field-func.c:818: warning: 'tok' may be used uninitialized in this function
gda-query-field-value.c:1192: warning: passing argument 1 of 'gda_query_field_value_set_dict_type' from incompatible pointer type
gda-query-field-value.c:1139: warning: 'tok' may be used uninitialized in this function
gda-query-join.c: In function 'gda_query_join_new_with_xml_ids':
gda-query-join.c:306: warning: 'tok' may be used uninitialized in this function
gda-query-target.c: In function 'gda_query_target_load_from_xml':
gda-query-target.c:803: warning: 'tok' may be used uninitialized in this function
gda-value.c: In function 'list_to_string':
gda-value.c:550: warning: 'str' is used uninitialized in this function
gda-value.c:539: warning: 'gstr' may be used uninitialized in this function
gda-util.c: In function 'gda_utility_parameter_load_attributes':
gda-util.c:801: warning: 'tok' may be used uninitialized in this function
sqlite3.c: In function 'sqlite3VdbeExec':
sqlite3.c:37787: warning: 'nErr' may be used uninitialized in this function
sqlite3.c:37537: warning: 'iMoved' may be used uninitialized in this function
sqlite3.c:37265: warning: 'res' may be used uninitialized in this function
gda-vprovider-data-model.c: In function 'gda_vprovider_data_model_open_connection':
gda-vprovider-data-model.c:247: warning: 'm_params' may be used uninitialized in this function
gda-mysql-ddl.c: In function 'gda_mysql_render_CREATE_TABLE':
gda-mysql-ddl.c:251: warning: 'nbfields' may be used uninitialized in this function
gda-mysql-recordset.c: In function 'gda_mysql_recordset_update_row':
gda-mysql-recordset.c:688: warning: 'mysql_row' may be used uninitialized in this function
gda-postgres-provider.c: In function 'gda_postgres_itemize_simple_array':
gda-postgres-provider.c:2461: warning: 'tok' may be used uninitialized in this function
gda-postgres-ddl.c: In function 'gda_postgres_render_CREATE_TABLE':
gda-postgres-ddl.c:259: warning: 'nbfields' may be used uninitialized in this function
utils.c: In function 'gda_postgres_make_error':
utils.c:84: warning: 'gda_code' is used uninitialized in this function
gda-author-dict-file.c: In function 'main':
gda-author-dict-file.c:113: warning: 'cnc' may be used uninitialized in this function
================================================================================
--- libgda/gda-data-model-bdb.c
+++ libgda/gda-data-model-bdb.c
@@ -788,7 +788,7 @@
GdaDataModelBdb *imodel;
DBT key, data;
int ret;
- GList *ptr;
+ GList *ptr = values;
gboolean key_modified = FALSE;
g_return_val_if_fail (GDA_IS_DATA_MODEL_BDB (model), FALSE);
--- libgda/gda-dict.c
+++ libgda/gda-dict.c
@@ -585,10 +585,10 @@
GHashTable *keys;
xmlNodePtr node;
- g_assert (node);
keys = g_hash_table_new_full (g_str_hash, g_str_equal, xmlFree, g_free);
node = xmlDocGetRootElement (doc);
+ g_assert (node);
xml_id_update_tree_recurs (doc, node, keys);
g_hash_table_destroy (keys);
}
--- libgda/gda-query-field-agg.c
+++ libgda/gda-query-field-agg.c
@@ -951,7 +951,7 @@
if (base) {
GString *string;
- GSList *list;
+ GSList *list = context;
string = g_string_new (gda_object_get_name (base));
g_string_append (string, " (");
--- libgda/gda-value.c
+++ libgda/gda-value.c
@@ -533,7 +533,7 @@
static void
list_to_string (const GValue *src, GValue *dest)
{
- gchar *str;
+ gchar *str = NULL;
const GdaValueList *list;
GList *l;
GString *gstr;
--- providers/postgres/utils.c
+++ providers/postgres/utils.c
@@ -56,7 +56,7 @@
gda_postgres_make_error (GdaConnection *cnc, PGconn *pconn, PGresult *pg_res)
{
GdaConnectionEvent *error;
- GdaConnectionEventCode gda_code;
+ GdaConnectionEventCode gda_code = GDA_CONNECTION_EVENT_CODE_UNKNOWN;
GdaTransactionStatus *trans;
error = gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
++++++ libgda-vfsmonitor.patch ++++++
--- /var/tmp/diff_new_pack.y23567/_old 2007-10-13 00:11:17.000000000 +0200
+++ /var/tmp/diff_new_pack.y23567/_new 2007-10-13 00:11:17.000000000 +0200
@@ -1,30 +1,84 @@
+http://bugzilla.gnome.org/show_bug.cgi?id=486021
+================================================================================
--- configure.in
+++ configure.in
-@@ -89,6 +89,7 @@
+@@ -82,6 +82,7 @@
+ gthread-2.0 >= req_ver_glib
gmodule-2.0 >= req_ver_glib
libxml-2.0
- libxslt >= req_ver_libxslt
+ gnome-vfs-2.0
])
+ LIBGDA_CFLAGS="$LIBGDA_CFLAGS -DLIBGDA_ABI_NAME=$LIBGDA_ABI_NAME"
AC_SUBST(LIBGDA_CFLAGS)
- AC_SUBST(LIBGDA_LIBS)
+@@ -116,29 +117,6 @@
+ AC_SUBST(SOPREFIX)
+
+ dnl ******************************
+-dnl Checking for FAM or gamin
+-dnl ******************************
+-FAM_LIBS=
+-FAM_CFLAGS=
+-FAM_MISSING_WARNING="Libgda depends on FAM to provide notification when configuration files are changed, without FAM support any application using Libgda will have to be restarted when configuration files are changed to take into account those changes"
+-PKG_CHECK_MODULES(GAMIN, gamin >= 0.1.8, have_fam=yes, have_fam=no)
+-if test x"$have_fam" = "xyes"
+-then
+- FAM_CFLAGS="$GAMIN_CFLAGS"
+- FAM_LIBS="$GAMIN_LIBS"
+- AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
+-else
+- AC_CHECK_LIB(fam, FAMOpen,
+- [AC_CHECK_HEADERS(fam.h,
+- [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
+- FAM_LIBS="-lfam"],
+- AC_MSG_WARN(*** FAM support will not be built (header files not found) $FAM_MISSING_WARNING ***))],
+- AC_MSG_WARN(*** FAM support will not be built (FAM library not found) $FAM_MISSING_WARNING ***))
+-fi
+-AC_SUBST(FAM_LIBS)
+-AC_SUBST(FAM_CFLAGS)
+-
+-dnl ******************************
+ dnl Checks for libgcrypt
+ dnl ******************************
+ LIBGCRYPT_CFLAGS=""
+--- libgda/Makefile.am
++++ libgda/Makefile.am
+@@ -11,7 +11,6 @@
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(LIBGDA_CFLAGS) \
+- $(FAM_CFLAGS) \
+ $(BDB_CFLAGS) \
+ $(GNOMEVFS_CFLAGS) \
+ $(LIBGCRYPT_CFLAGS)
+@@ -229,7 +228,7 @@
+ handlers/libgda_handlers-3.0.la \
+ binreloc/libgda_binreloc-3.0.la \
+ $(top_builddir)/libsql/libgdasql-3.0.la \
+- $(LIBGDA_LIBS) $(FAM_LIBS) \
++ $(LIBGDA_LIBS) \
+ $(BDB_LIBS) $(GNOMEVFS_LIBS) $(LIBGCRYPT_LIBS)
+
+ gdaincludedir=$(includedir)/libgda-$(GDA_ABI_MAJOR_VERSION).$(GDA_ABI_MINOR_VERSION)/libgda
--- libgda/gda-config.c
+++ libgda/gda-config.c
-@@ -34,10 +34,8 @@
+@@ -36,13 +36,8 @@
#include
#include
#include
-#ifdef HAVE_FAM
-#include
-#include
+-#include
+-#include
+-#include
-#endif
+#include
+#include
- #ifdef LIBGDA_WIN32
+ #ifdef G_OS_WIN32
#include
#endif
-@@ -72,19 +70,16 @@
- static void do_notify (const gchar *path);
+@@ -88,22 +83,16 @@
+ static gboolean dsn_list_only_in_mem = FALSE;
/*
- * FAM delcarations and static variables
@@ -33,9 +87,12 @@
-#ifdef HAVE_FAM
-static FAMConnection *fam_connection = NULL;
-static gint fam_watch_id = 0;
--gboolean lock_fam = FALSE;
--FAMRequest *fam_conf_user = NULL;
--FAMRequest *fam_conf_global = NULL;
+-static gboolean lock_fam = FALSE;
+-static FAMRequest *fam_conf_user = NULL;
+-static FAMRequest *fam_conf_global = NULL;
+-static time_t last_mtime = 0;
+-static time_t last_ctime = 0;
+-static off_t last_size = 0;
-
-static gboolean fam_callback (GIOChannel *source, GIOCondition condition, gpointer data);
-static void fam_lock_notify ();
@@ -52,7 +109,40 @@
/*
* Private functions
-@@ -287,48 +282,32 @@
+@@ -280,12 +269,12 @@
+ */
+ if (! config_client) {
+ GDA_CONFIG_LOCK ();
+- guint len = 0;
++ gsize len = 0;
+ gchar *full_file = NULL;
+ gchar *user_config = NULL;
++ gchar *global_config = NULL;
+ gboolean has_user_config = FALSE;
+ gchar *memonly;
+- gchar *fname;
+
+ config_client = g_new0 (GdaConfigClient, 1);
+ xmlKeepBlanksDefault(0);
+@@ -307,7 +296,7 @@
+ }
+
+ /* global config file name */
+- fname = gda_gbr_get_file_path (GDA_ETC_DIR, LIBGDA_ABI_NAME, "config", NULL);
++ global_config = gda_gbr_get_file_path (GDA_ETC_DIR, LIBGDA_ABI_NAME, "config", NULL);
+
+ has_user_config = g_get_home_dir () ? TRUE : FALSE;
+ if (has_user_config)
+@@ -316,7 +305,7 @@
+ {
+ /* compute system wide rights */
+ FILE *file;
+- file = fopen (fname, "a");
++ file = fopen (global_config, "a");
+ if (file) {
+ can_modify_global_conf = TRUE;
+ #ifdef GDA_DEBUG_NO
+@@ -332,52 +321,36 @@
}
}
@@ -62,14 +152,9 @@
- GIOChannel *ioc;
- int res;
-
-+ if (!monitor_global) {
-+ GnomeVFSResult res;
-+ char *uri;
-+
- #ifdef GDA_DEBUG
+-#ifdef GDA_DEBUG_NO
- g_print ("Using FAM to monitor configuration files changes.\n");
-+ g_print ("Using GNOME-VFS to monitor configuration files changes.\n");
- #endif
+-#endif
- fam_connection = g_malloc0 (sizeof (FAMConnection));
- if (FAMOpen2 (fam_connection, "libgnomedb user") != 0) {
- g_print ("FAMOpen failed, FAMErrno=%d\n", FAMErrno);
@@ -83,56 +168,99 @@
- fam_callback, NULL);
-
- fam_conf_global = g_new0 (FAMRequest, 1);
-- res = FAMMonitorFile (fam_connection, LIBGDA_GLOBAL_CONFIG_FILE, fam_conf_global,
+- res = FAMMonitorFile (fam_connection, fname, fam_conf_global,
- GINT_TO_POINTER (TRUE));
+-#ifdef GDA_DEBUG_NO
+- g_print ("Monitoring changes on file %s: %s\n", fname, res ? "ERROR" : "Ok");
++ if (!monitor_global) {
++ GnomeVFSResult res;
++ char *uri;
+
-+ uri = gnome_vfs_get_uri_from_local_path (LIBGDA_GLOBAL_CONFIG_FILE);
-+ res = gnome_vfs_monitor_add (&monitor_global, uri, GNOME_VFS_MONITOR_FILE, monitor_callback, NULL);
-+ g_free (uri);
- #ifdef GDA_DEBUG
-- g_print ("Monitoring changes on file %s: %s\n",
-- LIBGDA_GLOBAL_CONFIG_FILE, res ? "ERROR" : "Ok");
-+ g_print ("Monitoring changes on file %s: %s\n",
-+ LIBGDA_GLOBAL_CONFIG_FILE, res ? "ERROR" : "Ok");
++#ifdef GDA_DEBUG
++ g_print ("Using GNOME-VFS to monitor configuration files changes.\n");
#endif
-
- if (has_user_config) {
- fam_conf_user = g_new0 (FAMRequest, 1);
- res = FAMMonitorFile (fam_connection, user_config, fam_conf_user,
- GINT_TO_POINTER (FALSE));
-+
+-#ifdef GDA_DEBUG_NO
+- g_print ("Monitoring changes on file %s: %s\n",
+- user_config, res ? "ERROR" : "Ok");
++
++ uri = gnome_vfs_get_uri_from_local_path (global_config);
++ res = gnome_vfs_monitor_add (&monitor_global, uri, GNOME_VFS_MONITOR_FILE, monitor_callback, NULL);
++ g_free (uri);
++#ifdef GDA_DEBUG
++ g_print ("Monitoring changes on file %s: %s\n",
++ fam_conf_global, res ? "ERROR" : "Ok");
+ #endif
+- }
+- }
+
+- }
+ if (has_user_config) {
+ uri = gnome_vfs_get_uri_from_local_path (user_config);
+ res = gnome_vfs_monitor_add (&monitor_user, uri, GNOME_VFS_MONITOR_FILE, monitor_callback, NULL);
+ g_free (uri);
- #ifdef GDA_DEBUG
-- g_print ("Monitoring changes on file %s: %s\n",
-- user_config, res ? "ERROR" : "Ok");
++#ifdef GDA_DEBUG
+ g_print ("Monitoring changes on file %s: %s\n",
+ user_config, res ? "ERROR" : "Ok");
#endif
-- }
- }
--
++ }
+
+ /*
+ * load system wide config
+ */
+- if (g_file_get_contents (fname, &full_file, &len, NULL)){
++ if (g_file_get_contents (global_config, &full_file, &len, NULL)){
+ GList *list;
+ config_client->global = gda_config_parse_config_file (full_file, len);
+ g_free (full_file);
+@@ -392,7 +365,7 @@
+
+ if (! has_user_config) {
+ /* this can occur on win98, and maybe other win32 platforms */
+- g_free (fname);
++ g_free (global_config);
+ GDA_CONFIG_UNLOCK ();
+ return config_client;
}
--#endif
-
- config_client = g_new0 (GdaConfigClient, 1);
- xmlKeepBlanksDefault(0);
-@@ -442,71 +421,50 @@
+@@ -475,11 +448,12 @@
+ g_warning ("Config file is not readable.");
+ }
+ g_free (user_config);
+- g_free (fname);
++ g_free (global_config);
+ #ifdef GDA_DEBUG_NO
+ dump_config_client ();
+ #endif
+ GDA_CONFIG_UNLOCK ();
++ }
+ }
+
+ return config_client;
+@@ -487,88 +461,50 @@
static void gda_config_client_reset ();
-#ifdef HAVE_FAM
-static gboolean
-fam_callback (GIOChannel *source, GIOCondition condition, gpointer data)
--{
++static void
++monitor_callback (GnomeVFSMonitorHandle *handle,
++ const gchar *monitor_uri,
++ const gchar *info_uri,
++ GnomeVFSMonitorEventType event_type,
++ gpointer user_data)
+ {
- gboolean res = TRUE;
--
++ gboolean is_global;
+
+- GDA_CONFIG_LOCK ();
- while (fam_connection && FAMPending (fam_connection)) {
- FAMEvent ev;
- gboolean is_global;
-- gchar *msg = NULL;
-
- if (FAMNextEvent (fam_connection, &ev) != 1) {
- FAMClose (fam_connection);
@@ -140,17 +268,10 @@
- g_source_remove (fam_watch_id);
- fam_watch_id = 0;
- fam_connection = NULL;
+- GDA_CONFIG_UNLOCK ();
- return FALSE;
- }
-+static void
-+monitor_callback (GnomeVFSMonitorHandle *handle,
-+ const gchar *monitor_uri,
-+ const gchar *info_uri,
-+ GnomeVFSMonitorEventType event_type,
-+ gpointer user_data)
-+{
-+ gboolean is_global;
-
+-
- if (lock_fam)
- continue;
+ if (monitor_lock)
@@ -158,23 +279,39 @@
- is_global = GPOINTER_TO_INT (ev.userdata);
- switch (ev.code) {
-- case FAMChanged:
+- case FAMChanged: {
+- struct stat stat;
+- if (lstat (ev.filename, &stat))
+- break;
+- if ((stat.st_mtime != last_mtime) ||
+- (stat.st_ctime != last_ctime) ||
+- (stat.st_size != last_size)) {
+- last_mtime = stat.st_mtime;
+- last_ctime = stat.st_ctime;
+- last_size = stat.st_size;
+- }
+- else
+- break;
+- }
- case FAMDeleted:
- case FAMCreated:
+-#ifdef GDA_DEBUG_NO
+- g_print ("Reloading config files (%s config has changed)\n", is_global ? "global" : "user");
+ is_global = GPOINTER_TO_INT (user_data);
+ switch (event_type) {
+ case GNOME_VFS_MONITOR_EVENT_CHANGED:
+ case GNOME_VFS_MONITOR_EVENT_DELETED:
+ case GNOME_VFS_MONITOR_EVENT_CREATED:
- #ifdef GDA_DEBUG
-- g_print ("Reloading config files (%s config has changed)\n", is_global ? "global" : "user");
++#ifdef GDA_DEBUG
+ g_print ("Reloading config files (%s config has changed)\n", is_global ? "global" : "user");
#endif
+- GDA_CONFIG_LOCK ();
- gda_config_client_reset ();
- g_free (config_client);
- config_client = NULL;
- /* config_client will be re-created next time a gda_config* call is made */
- do_notify (NULL);
+- GDA_CONFIG_UNLOCK ();
- break;
- case FAMAcknowledge:
- case FAMStartExecuting:
@@ -196,6 +333,7 @@
+ break;
}
-
+- GDA_CONFIG_UNLOCK ();
- return res;
}
@@ -220,7 +358,7 @@
static GdaConfigSection *
gda_config_search_section (GList *sections, const gchar *path)
{
-@@ -706,14 +664,10 @@
+@@ -785,14 +721,10 @@
}
user_config = g_strdup_printf ("%s%s", g_get_home_dir (), LIBGDA_USER_CONFIG_FILE);
@@ -237,20 +375,25 @@
g_free (user_config);
xmlFreeDoc (doc);
-@@ -738,14 +692,10 @@
+@@ -817,9 +749,7 @@
}
}
-#ifdef HAVE_FAM
-- fam_lock_notify ();
+- fam_lock_notify ();
-#endif
+ monitor_lock_notify ();
- if (xmlSaveFormatFile (LIBGDA_GLOBAL_CONFIG_FILE, doc, TRUE) == -1)
+ /* global config file name */
+ gchar *fname;
+ fname = gda_gbr_get_file_path (GDA_ETC_DIR, LIBGDA_ABI_NAME, "config", NULL);
+@@ -827,9 +757,7 @@
+ if (xmlSaveFormatFile (fname, doc, TRUE) == -1)
g_warning ("Error saving config data to '%s'", user_config);
+ g_free (fname);
-#ifdef HAVE_FAM
-- fam_unlock_notify ();
+- fam_unlock_notify ();
-#endif
+ monitor_unlock_notify ();
xmlFreeDoc (doc);
}
- }
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org