- Backport assorted fixes from upstream svn (Fix Fedora bug 426060)

This commit is contained in:
Deji Akingunola 2008-01-27 22:16:09 +00:00
parent 4a0060def7
commit 74cdc8a039
2 changed files with 134 additions and 50 deletions

View File

@ -1,49 +1,3 @@
#Fix crasher where index name is null during merging and fixed invalid log file
--- src/trackerd/trackerd.c 2007/12/11 02:57:07 1070
+++ src/trackerd/trackerd.c 2007/12/11 18:25:27 1074
@@ -2486,12 +2486,6 @@
tracker->is_running = FALSE;
- tracker->log_file = g_build_filename (tracker->root_dir, "tracker.log", NULL);
-
- tracker->dbus_con = tracker_dbus_init ();
-
- add_local_dbus_connection_monitoring (tracker->dbus_con);
-
/* Make a temporary directory for Tracker into g_get_tmp_dir() directory */
gchar *tmp_dir;
@@ -2505,6 +2499,18 @@
tracker->config_dir = g_strdup (g_get_user_config_dir ());
tracker->user_data_dir = g_build_filename (tracker->root_dir, "data", NULL);
+ tracker->log_file = g_build_filename (tracker->root_dir, "tracker.log", NULL);
+
+ /* reset log file */
+ tracker_unlink (tracker->log_file);
+
+ tracker_log ("starting log");
+
+ tracker->dbus_con = tracker_dbus_init ();
+
+ add_local_dbus_connection_monitoring (tracker->dbus_con);
+
+
g_free (tmp_dir);
/* remove an existing one */
@@ -2636,9 +2642,7 @@
ioprio ();
#endif
- /* reset log file */
- tracker_unlink (tracker->log_file);
-
+
/* deal with config options with defaults, config file and option params */
set_defaults ();
--- src/trackerd/tracker-indexer.c 2007/12/10 23:37:31 1068 --- src/trackerd/tracker-indexer.c 2007/12/10 23:37:31 1068
+++ src/trackerd/tracker-indexer.c 2007/12/11 21:16:02 1076 +++ src/trackerd/tracker-indexer.c 2007/12/11 21:16:02 1076
@@ -215,7 +215,7 @@ @@ -215,7 +215,7 @@
@ -165,3 +119,130 @@
} }
} }
--- src/trackerd/tracker-utils.c 2007/12/11 18:29:27 1075
+++ src/trackerd/tracker-utils.c 2007/12/13 23:55:10 1079
@@ -3491,11 +3491,13 @@
/* logging is thread safe */
static size_t log_size = 0;
- if (! message)
+ if (!message)
return;
g_print ("%s\n", message);
+ if (!tracker->log_file) return;
+
/* ensure file logging is thread safe */
g_mutex_lock (tracker->log_access_mutex);
--- src/trackerd/trackerd.c 2007/12/11 02:57:07 1070
+++ src/trackerd/trackerd.c 2007/12/13 23:55:10 1079
@@ -618,19 +618,13 @@
static void
signal_handler (gint signo)
{
- if (!tracker->is_running) {
- return;
- }
-
static gboolean in_loop = FALSE;
- /* avoid re-entrant signals handler calls */
- if (in_loop && signo != SIGSEGV) {
- return;
+ /* die if we get re-entrant signals handler calls */
+ if (in_loop) {
+ exit (EXIT_FAILURE);
}
- in_loop = TRUE;
-
switch (signo) {
case SIGSEGV:
@@ -646,6 +640,8 @@
case SIGTERM:
case SIGINT:
+ in_loop = TRUE;
+
tracker->is_running = FALSE;
tracker_end_watching ();
@@ -660,8 +656,7 @@
if (tracker->log_file && g_strsignal (signo)) {
tracker_log ("Received signal %s ", g_strsignal (signo));
}
- in_loop = FALSE;
- break;
+ break;
}
}
@@ -2422,6 +2417,14 @@
if (!g_thread_supported ())
g_thread_init (NULL);
+ dbus_g_thread_init ();
+
+ tracker = g_new0 (Tracker, 1);
+
+ tracker->dbus_con = tracker_dbus_init ();
+
+ add_local_dbus_connection_monitoring (tracker->dbus_con);
+
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, TRACKER_LOCALEDIR);
@@ -2478,20 +2481,14 @@
sigaction (SIGINT, &act, NULL);
#endif
- dbus_g_thread_init ();
+
- tracker = g_new0 (Tracker, 1);
+
tracker->status = STATUS_INIT;
tracker->is_running = FALSE;
- tracker->log_file = g_build_filename (tracker->root_dir, "tracker.log", NULL);
-
- tracker->dbus_con = tracker_dbus_init ();
-
- add_local_dbus_connection_monitoring (tracker->dbus_con);
-
/* Make a temporary directory for Tracker into g_get_tmp_dir() directory */
gchar *tmp_dir;
@@ -2505,6 +2502,16 @@
tracker->config_dir = g_strdup (g_get_user_config_dir ());
tracker->user_data_dir = g_build_filename (tracker->root_dir, "data", NULL);
+ tracker->log_file = g_build_filename (tracker->root_dir, "tracker.log", NULL);
+
+ /* reset log file */
+ tracker_unlink (tracker->log_file);
+
+ tracker_log ("starting log");
+
+
+
+
g_free (tmp_dir);
/* remove an existing one */
@@ -2636,9 +2643,7 @@
ioprio ();
#endif
- /* reset log file */
- tracker_unlink (tracker->log_file);
-
+
/* deal with config options with defaults, config file and option params */
set_defaults ();

View File

@ -1,12 +1,12 @@
Summary: An object database, tag/metadata database, search tool and indexer Summary: An object database, tag/metadata database, search tool and indexer
Name: tracker Name: tracker
Version: 0.6.4 Version: 0.6.4
Release: 4%{?dist} Release: 5%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/System Group: Applications/System
URL: http://www.gnome.org/~jamiemcc/tracker/ URL: http://www.gnome.org/~jamiemcc/tracker/
Source0: http://www.gnome.org/~jamiemcc/tracker/%{name}-%{version}.tar.bz2 Source0: http://www.gnome.org/~jamiemcc/tracker/%{name}-%{version}.tar.bz2
Patch0: tracker-post_0.6.4_fixes.patch Patch0: tracker-assorted_fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gmime-devel, poppler-devel, gettext BuildRequires: gmime-devel, poppler-devel, gettext
BuildRequires: gnome-desktop-devel, gamin-devel, libnotify-devel BuildRequires: gnome-desktop-devel, gamin-devel, libnotify-devel
@ -52,7 +52,7 @@ GNOME libraries
%prep %prep
%setup -q %setup -q
#%patch0 -p0 -b .fix %patch0 -p0 -b .fix
%define deskbar_applet_ver %(pkg-config --modversion deskbar-applet) %define deskbar_applet_ver %(pkg-config --modversion deskbar-applet)
%if "%deskbar_applet_ver" >= "2.19.4" %if "%deskbar_applet_ver" >= "2.19.4"
@ -137,6 +137,9 @@ fi
%{_sysconfdir}/xdg/autostart/tracker-applet.desktop %{_sysconfdir}/xdg/autostart/tracker-applet.desktop
%changelog %changelog
* Thu Jan 24 2008 Deji Akingunola <dakingun@gmail.com> - 0.6.4-5
- Backport assorted fixes from upstream svn (Fix Fedora bug 426060)
* Mon Jan 21 2008 Deji Akingunola <dakingun@gmail.com> - 0.6.4-4 * Mon Jan 21 2008 Deji Akingunola <dakingun@gmail.com> - 0.6.4-4
- Now require the externally packaged o3read to provide o3totxt - Now require the externally packaged o3read to provide o3totxt