tracker r1706 - in branches/xesam-support: . data/dbus src/libtracker-db src/tracker-indexer tests tests/scripts



Author: pvanhoof
Date: Tue Jun 17 15:58:26 2008
New Revision: 1706
URL: http://svn.gnome.org/viewvc/tracker?rev=1706&view=rev

Log:
Synced with indexer-split

Added:
   branches/xesam-support/tests/scripts/Makefile.am
      - copied unchanged from r1705, /branches/indexer-split/tests/scripts/Makefile.am
Modified:
   branches/xesam-support/ChangeLog
   branches/xesam-support/INSTALL
   branches/xesam-support/configure.ac
   branches/xesam-support/data/dbus/tracker-indexer.xml
   branches/xesam-support/src/libtracker-db/tracker-db-manager.c
   branches/xesam-support/src/libtracker-db/tracker-db-manager.h
   branches/xesam-support/src/tracker-indexer/tracker-indexer.c
   branches/xesam-support/src/tracker-indexer/tracker-indexer.h
   branches/xesam-support/src/tracker-indexer/tracker-main.c
   branches/xesam-support/tests/Makefile.am

Modified: branches/xesam-support/INSTALL
==============================================================================
--- branches/xesam-support/INSTALL	(original)
+++ branches/xesam-support/INSTALL	Tue Jun 17 15:58:26 2008
@@ -2,7 +2,7 @@
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007 Free Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -67,6 +67,9 @@
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
 Compilers and Options
 =====================
 

Modified: branches/xesam-support/configure.ac
==============================================================================
--- branches/xesam-support/configure.ac	(original)
+++ branches/xesam-support/configure.ac	Tue Jun 17 15:58:26 2008
@@ -747,6 +747,7 @@
 	tests/trackerd/xesam/Makefile
 	tests/scripts/dummy_data_start.sh
 	tests/scripts/dummy_data_stop.sh
+	tests/scripts/Makefile
 	src/xdgmime/Makefile
 	po/Makefile.in
 	python/Makefile

Modified: branches/xesam-support/data/dbus/tracker-indexer.xml
==============================================================================
--- branches/xesam-support/data/dbus/tracker-indexer.xml	(original)
+++ branches/xesam-support/data/dbus/tracker-indexer.xml	Tue Jun 17 15:58:26 2008
@@ -25,6 +25,7 @@
     <method name="DeleteFiles">
       <arg type="as" name="files" direction="in" />
     </method>
+    <method name="Reindex"/>
     
     <!-- The old signal in the daemon used to send the time taken, we
 	 can add this later

Modified: branches/xesam-support/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/xesam-support/src/libtracker-db/tracker-db-manager.c	(original)
+++ branches/xesam-support/src/libtracker-db/tracker-db-manager.c	Tue Jun 17 15:58:26 2008
@@ -26,6 +26,7 @@
 #include <zlib.h>
 
 #include <libtracker-common/tracker-field.h>
+#include <libtracker-common/tracker-file-utils.h>
 #include <libtracker-common/tracker-nfs-lock.h>
 #include <libtracker-common/tracker-ontology.h>
 #include <libtracker-common/tracker-type-utils.h>
@@ -39,7 +40,7 @@
 typedef enum {
         TRACKER_DB_LOCATION_DATA_DIR,
         TRACKER_DB_LOCATION_USER_DATA_DIR,
-        TRACKER_DB_LOCATION_SYS_TMP_ROOT_DIR,
+        TRACKER_DB_LOCATION_SYS_TMP_DIR,
 } TrackerDBLocation;
 
 typedef struct {
@@ -65,7 +66,7 @@
           TRACKER_DB_PAGE_SIZE_DEFAULT, 
           FALSE },
         { TRACKER_DB_CACHE, 
-          TRACKER_DB_LOCATION_SYS_TMP_ROOT_DIR,
+          TRACKER_DB_LOCATION_SYS_TMP_DIR,
 	  NULL,
           "cache.db",
           "cache",
@@ -126,36 +127,34 @@
 static TrackerDBInterface *db_interface_create (TrackerDB           db,
 						gboolean            attach_all);
 
-static gboolean      initialized;
-static gboolean      attach_all;
-static GHashTable   *prepared_queries;
-static gchar        *services_dir;
-static gchar        *sql_dir;
-static gpointer      db_type_enum_class_pointer;
+static gboolean            initialized;
+static gboolean            attach_all;
+static GHashTable         *prepared_queries;
+static gchar              *db_services_dir;
+static gchar              *db_sql_dir;
+static gchar              *db_data_dir;
+static gchar              *db_user_data_dir;
+static gchar              *db_sys_tmp_dir;
+static gpointer            db_type_enum_class_pointer;
 static TrackerDBInterface *attach_interface = NULL;
 
 static const gchar * 
-location_to_directory (TrackerDBLocation  location,
-                       const gchar       *data_dir,
-                       const gchar       *user_data_dir,
-                       const gchar       *sys_tmp_root_dir)
+location_to_directory (TrackerDBLocation location)
 {
         switch (location) {
         case TRACKER_DB_LOCATION_DATA_DIR:
-                return data_dir;
+                return db_data_dir;
         case TRACKER_DB_LOCATION_USER_DATA_DIR:
-                return user_data_dir;
-        case TRACKER_DB_LOCATION_SYS_TMP_ROOT_DIR:
-                return sys_tmp_root_dir;
+                return db_user_data_dir;
+        case TRACKER_DB_LOCATION_SYS_TMP_DIR:
+                return db_sys_tmp_dir;
         };
 
 	return NULL;
 }
 
 void 
-set_up_databases (const gchar *data_dir,
-		  const gchar *user_data_dir,
-		  const gchar *sys_tmp_root_dir)
+set_up_databases (void)
 {
         const gchar *dir;
         guint        i;
@@ -164,12 +163,8 @@
 
         for (i = 0; i < G_N_ELEMENTS (dbs); i++) {
                 /* Fill absolute path for the database */
-                dir = location_to_directory (dbs[i].location,
-                                             data_dir, 
-                                             user_data_dir, 
-                                             sys_tmp_root_dir);
-                
-                dbs[i].abs_filename = g_build_filename (dir, dbs[i].file, NULL);
+                dir = location_to_directory (dbs[i].location);
+		dbs[i].abs_filename = g_build_filename (dir, dbs[i].file, NULL);
         }
 
 	g_message ("Setting up all databases completed");
@@ -183,7 +178,7 @@
 	gchar *path, *content, **queries;
 	gint i;
 
-	path = g_build_filename (sql_dir, file, NULL);
+	path = g_build_filename (db_sql_dir, file, NULL);
 
 	if (!delimiter) {
 		delimiter = ";";
@@ -219,7 +214,7 @@
 	gint           id, i, j;
 
 	key_file = g_key_file_new ();
-	service_file = g_build_filename (services_dir, filename, NULL);
+	service_file = g_build_filename (db_services_dir, filename, NULL);
 
 	if (!g_key_file_load_from_file (key_file, service_file, G_KEY_FILE_NONE, NULL)) {
 		g_free (service_file);
@@ -280,9 +275,11 @@
 				gchar *esc_value;
 
 				esc_value = tracker_escape_string (new_value);
+				
 				tracker_db_interface_execute_query (iface, NULL,
 								    "update MetaDataTypes set  %s = '%s' where ID = %d",
 								    keys[j], esc_value, id);
+
 				g_free (esc_value);
 			}
 
@@ -308,7 +305,7 @@
 	gchar          **groups, **keys;
 	gint             i, j, id;
 
-	service_file = g_build_filename (services_dir, filename, NULL);
+	service_file = g_build_filename (db_services_dir, filename, NULL);
 
 	key_file = g_key_file_new ();
 
@@ -440,6 +437,7 @@
 								    keys[j], 
 								    esc_value, 
 								    str_id);
+
 				g_free (esc_value);
 				g_free (value);
 				g_free (new_value);
@@ -602,7 +600,7 @@
 	};
 
 	key_file = g_key_file_new ();
-	service_file = g_build_filename (services_dir, filename, NULL);
+	service_file = g_build_filename (db_services_dir, filename, NULL);
 
 	if (!g_key_file_load_from_file (key_file, service_file, G_KEY_FILE_NONE, &error)) {
 		g_critical ("Couldn't load XESAM service file:'%s', %s",
@@ -659,7 +657,7 @@
 				      *group, 
 				      NULL);
 			id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (iface));
-		}
+ 		}
 		
 		/* Get inserted ID */
 		str_id = tracker_uint_to_string (id);
@@ -793,20 +791,20 @@
 	GError      *error = NULL;
 	GMappedFile *mapped_file;
 	GStrv        queries;
-	gchar       *sql_filename;
+	gchar       *filename;
 	gdouble      secs;
 
 	g_message ("Loading prepared queries...");
 
-	sql_filename = g_build_filename (sql_dir, "sqlite-stored-procs.sql", NULL);
+	filename = g_build_filename (db_sql_dir, "sqlite-stored-procs.sql", NULL);
 
 	t = g_timer_new ();
 
-	mapped_file = g_mapped_file_new (sql_filename, FALSE, &error);
+	mapped_file = g_mapped_file_new (filename, FALSE, &error);
 
 	if (error || !mapped_file) {
 		g_warning ("Could not get contents of SQL file:'%s', %s",
-			   sql_filename,
+			   filename,
 			   error ? error->message : "no error given");
 
 		if (mapped_file) {
@@ -814,17 +812,17 @@
 		}
 
 		g_timer_destroy (t);
-		g_free (sql_filename);
+		g_free (filename);
 
 		return FALSE;
 	}
 
 	g_message ("Loaded prepared queries file:'%s' size:%" G_GSIZE_FORMAT " bytes",
-		   sql_filename,
+		   filename,
 		   g_mapped_file_get_length (mapped_file));
 
 	queries = g_strsplit (g_mapped_file_get_contents (mapped_file), "\n", -1);
-	g_free (sql_filename);
+	g_free (filename);
 
 	if (queries) {
 		GStrv p;
@@ -996,6 +994,7 @@
 	gchar              *service_id_str;
 
 	service_id_str = g_strdup_printf ("%d", service_id);
+
 	result_set = tracker_db_interface_execute_procedure (iface, 
                                                              NULL, 
                                                              stored_proc, 
@@ -1782,6 +1781,7 @@
 						     "compress",
 						     function_compress,
 						     1);
+
 	return iface;
 }
 
@@ -1826,6 +1826,7 @@
 						     "compress",
 						     function_compress,
 						     1);
+
 	return iface;
 }
 
@@ -2163,13 +2164,16 @@
 	db_type_enum_class_pointer = g_type_class_ref (etype);
 
 	/* Set up locations */
-	services_dir = g_build_filename (SHAREDIR, 
-					 "tracker", 
-					 "services", 
-					 NULL);
-	sql_dir = g_build_filename (SHAREDIR, 
-				    "tracker", 
-				    NULL);
+	db_services_dir = g_build_filename (SHAREDIR, 
+					    "tracker", 
+					    "services", 
+					    NULL);
+	db_sql_dir = g_build_filename (SHAREDIR, 
+				       "tracker", 
+				       NULL);
+	db_data_dir = g_strdup (data_dir);
+	db_user_data_dir = g_strdup (user_data_dir);
+	db_sys_tmp_dir = g_strdup (sys_tmp_dir);
 
 	/* Add prepared queries */
 	prepared_queries = g_hash_table_new_full (g_str_hash,
@@ -2180,10 +2184,7 @@
 	load_prepared_queries ();
 
 	/* Configure database locations and interfaces */
-	set_up_databases (data_dir, 
-			  user_data_dir, 
-			  sys_tmp_dir);
-
+	set_up_databases ();
 
 	initialized = TRUE;
 }
@@ -2212,8 +2213,11 @@
 	g_hash_table_unref (prepared_queries);
 	prepared_queries = NULL;
 
-        g_free (services_dir);
-        g_free (sql_dir);
+	g_free (db_data_dir);
+	g_free (db_user_data_dir);
+	g_free (db_sys_tmp_dir);
+        g_free (db_services_dir);
+        g_free (db_sql_dir);
 
 	/* Since we don't reference this enum anywhere, we do
 	 * it here to make sure it exists when we call
@@ -2234,15 +2238,87 @@
         initialized = FALSE;
 }
 
+gboolean
+tracker_db_manager_need_reindex (void) 
+{
+	g_return_val_if_fail (initialized != FALSE, FALSE);
+
+	if (!g_file_test (db_data_dir, G_FILE_TEST_EXISTS)) {
+		return TRUE;
+	}
+
+	if (!g_file_test (db_user_data_dir, G_FILE_TEST_EXISTS)) {
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+void
+tracker_db_manager_set_up_databases (gboolean remove_all_first) 
+{
+	gboolean current_attach_all;
+	guint    i;
+
+	g_return_if_fail (initialized != FALSE);
+
+	if (remove_all_first) {
+		g_message ("Removing directory:'%s'", db_data_dir);
+		tracker_path_remove (db_data_dir);
+
+		g_message ("Removing directory:'%s'", db_user_data_dir);
+		tracker_path_remove (db_user_data_dir);
+
+		g_message ("Removing directory:'%s'", db_sys_tmp_dir);
+		tracker_path_remove (db_sys_tmp_dir);
+	}
+
+	/* Don't check for these first, just do it */
+	g_message ("Creating directory:'%s'", db_data_dir);
+	g_mkdir_with_parents (db_data_dir, 00755);
+
+	g_message ("Creating directory:'%s'", db_user_data_dir);
+	g_mkdir_with_parents (db_user_data_dir, 00755);
+
+	g_message ("Creating directory:'%s'", db_sys_tmp_dir);
+	g_mkdir_with_parents (db_sys_tmp_dir, 00755);
+
+	/* Save the current attach setting */
+	current_attach_all = attach_all;
+
+	/* Don't attach while we do this... */
+	attach_all = FALSE;
+
+	/* Create all interfaces (and dbs as a result) and then unref
+	 * them to close the dbs.
+	 */
+        for (i = 0; i < G_N_ELEMENTS (dbs); i++) {
+		tracker_db_manager_get_db_interface (i);
+		g_object_unref (dbs[i].iface);
+
+		/* Reset the interface value so we get a new object
+		 * next time it is needed.
+		 */
+		dbs[i].iface = NULL;
+        }
+
+	/* Set the attach setting back to what it was */
+	attach_all = current_attach_all;
+}
+
 const gchar *
 tracker_db_manager_get_file (TrackerDB db) 
 {
+	g_return_val_if_fail (initialized != FALSE, NULL);
+
         return dbs[db].abs_filename;
 }
 
 TrackerDBInterface *
 tracker_db_manager_get_db_interface (TrackerDB db)
 {
+	g_return_val_if_fail (initialized != FALSE, NULL);
+
 	if (!dbs[db].iface) {
 		dbs[db].iface = db_interface_create (db, attach_all);
 	}
@@ -2257,6 +2333,7 @@
 	TrackerDBType type;
 	TrackerDB     db;
 
+	g_return_val_if_fail (initialized != FALSE, NULL);
 	g_return_val_if_fail (service != NULL, NULL);
 
 	type = tracker_ontology_get_db_for_service_type (service);
@@ -2287,6 +2364,7 @@
 {
 	guint i;
 
+	g_return_val_if_fail (initialized != FALSE, NULL);
 	g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
 
         for (i = 0; i < G_N_ELEMENTS (dbs); i++) {
@@ -2303,3 +2381,4 @@
 
 	return NULL;
 }
+

Modified: branches/xesam-support/src/libtracker-db/tracker-db-manager.h
==============================================================================
--- branches/xesam-support/src/libtracker-db/tracker-db-manager.h	(original)
+++ branches/xesam-support/src/libtracker-db/tracker-db-manager.h	Tue Jun 17 15:58:26 2008
@@ -49,7 +49,9 @@
 							     const gchar        *user_data_dir,
 							     const gchar        *sys_tmp_root_dir);
 void         tracker_db_manager_shutdown                    (void);
+gboolean     tracker_db_manager_need_reindex                (void);
 
+void         tracker_db_manager_set_up_databases            (gboolean            remove_all_first);
 const gchar *tracker_db_manager_get_file                    (TrackerDB           db);
 TrackerDBInterface *
              tracker_db_manager_get_db_interface            (TrackerDB           db);

Modified: branches/xesam-support/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/xesam-support/src/tracker-indexer/tracker-indexer.c	(original)
+++ branches/xesam-support/src/tracker-indexer/tracker-indexer.c	Tue Jun 17 15:58:26 2008
@@ -109,7 +109,6 @@
 enum {
 	PROP_0,
 	PROP_RUNNING,
-	PROP_REINDEX
 };
 
 enum {
@@ -143,6 +142,24 @@
 }
 
 static void
+reindex_database (TrackerIndexer *indexer)
+{
+	TrackerIndexerPrivate *priv;
+
+	priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
+
+	priv->common = NULL;
+	priv->metadata = NULL;
+	priv->contents = NULL;
+	
+	tracker_db_manager_set_up_databases (TRUE);
+
+	priv->common = tracker_db_manager_get_db_interface (TRACKER_DB_COMMON);
+	priv->metadata = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
+	priv->contents = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_CONTENTS);
+}
+
+static void
 tracker_indexer_finalize (GObject *object)
 {
 	TrackerIndexerPrivate *priv;
@@ -187,9 +204,6 @@
 					     g_value_get_boolean (value), 
 					     NULL);
 		break;
-	case PROP_REINDEX:
-		priv->reindex = g_value_get_boolean (value);
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 	}
@@ -247,13 +261,6 @@
 							       "Whether the indexer is running",
 							       TRUE,
 							       G_PARAM_READWRITE));
-	g_object_class_install_property (object_class,
-					 PROP_REINDEX,
-					 g_param_spec_boolean ("reindex",
-							       "Reindex",
-							       "Whether to reindex contents",
-							       FALSE,
-							       G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
 
 	g_type_class_add_private (object_class,
 				  sizeof (TrackerIndexerPrivate));
@@ -274,7 +281,8 @@
 	priv->language = tracker_language_new (priv->config);
 
 	priv->db_dir = g_build_filename (g_get_user_cache_dir (),
-					 "tracker", NULL);
+					 "tracker", 
+					 NULL);
 
 	priv->module_names = tracker_config_get_index_modules (priv->config);
 
@@ -293,13 +301,9 @@
 					     m->data, module);
 		}
 	}
-
-	if (priv->reindex || !g_file_test (priv->db_dir, G_FILE_TEST_IS_DIR)) {
-		tracker_path_remove (priv->db_dir);
-	}
-
-	if (!g_file_test (priv->db_dir, G_FILE_TEST_EXISTS)) {
-		g_mkdir_with_parents (priv->db_dir, 00755);
+	
+	if (tracker_db_manager_need_reindex ()) {
+		reindex_database (indexer);
 	}
 
 	index_file = g_build_filename (priv->db_dir, "file-index.db", NULL);
@@ -519,15 +523,17 @@
 	gchar **dirs;
 	gint i;
 
-	g_message ("Starting module:'%s'", module_name);
-
 	priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
 	module = g_hash_table_lookup (priv->indexer_modules, module_name);
 
-	g_return_if_fail (module != NULL);
+	if (!module) {
+		g_message ("No module for:'%s'", module_name);
+		return;
+	}
 
-	dirs = tracker_indexer_module_get_directories (module);
+	g_message ("Starting module:'%s'", module_name);
 
+	dirs = tracker_indexer_module_get_directories (module);
 	g_return_if_fail (dirs != NULL);
 
 	for (i = 0; dirs[i]; i++) {
@@ -542,7 +548,6 @@
 	g_free (dirs);
 }
 
-
 static gboolean
 indexing_func (gpointer data)
 {
@@ -584,11 +589,9 @@
 }
 
 TrackerIndexer *
-tracker_indexer_new (gboolean reindex)
+tracker_indexer_new (void)
 {
-	return g_object_new (TRACKER_TYPE_INDEXER,
-			     "reindex", reindex,
-			     NULL);
+	return g_object_new (TRACKER_TYPE_INDEXER, NULL);
 }
 
 gboolean
@@ -781,3 +784,26 @@
 
 	return TRUE;
 }
+
+gboolean
+tracker_indexer_reindex (TrackerIndexer  *indexer,
+			 GError         **error)
+{
+	TrackerIndexerPrivate *priv;
+	guint                  request_id;
+
+	tracker_dbus_return_val_if_fail (TRACKER_IS_INDEXER (indexer), FALSE, error);
+
+	priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
+	request_id = tracker_dbus_get_next_request_id ();
+
+	tracker_dbus_request_new (request_id,
+                                  "DBus request to reindex the database");
+
+
+	reindex_database (indexer);
+	
+	tracker_dbus_request_success (request_id);
+
+	return TRUE;
+}

Modified: branches/xesam-support/src/tracker-indexer/tracker-indexer.h
==============================================================================
--- branches/xesam-support/src/tracker-indexer/tracker-indexer.h	(original)
+++ branches/xesam-support/src/tracker-indexer/tracker-indexer.h	Tue Jun 17 15:58:26 2008
@@ -51,8 +51,8 @@
 	void (*index_updated) (TrackerIndexer *indexer);
 };
 
-GType           tracker_indexer_get_type      (void) G_GNUC_CONST;
-TrackerIndexer *tracker_indexer_new          (gboolean         reindex);
+GType           tracker_indexer_get_type     (void) G_GNUC_CONST;
+TrackerIndexer *tracker_indexer_new          (void);
 gboolean        tracker_indexer_set_running  (TrackerIndexer  *indexer,
 					      gboolean         should_be_running,
 					      GError         **error);
@@ -68,6 +68,8 @@
 gboolean        tracker_indexer_delete_files (TrackerIndexer  *indexer,
 					      GStrv            files,
 					      GError         **error);
+gboolean        tracker_indexer_reindex      (TrackerIndexer  *indexer,
+					      GError         **error);
 
 G_END_DECLS
 

Modified: branches/xesam-support/src/tracker-indexer/tracker-main.c
==============================================================================
--- branches/xesam-support/src/tracker-indexer/tracker-main.c	(original)
+++ branches/xesam-support/src/tracker-indexer/tracker-main.c	Tue Jun 17 15:58:26 2008
@@ -54,21 +54,21 @@
         "\n"								\
 	"  http://www.gnu.org/licenses/gpl.txt\n"; 
 
-static GMainLoop  *main_loop;
-
-static gboolean	   reindex;
-static gint	   verbosity = -1;
-
-static GOptionEntry entries[] = {
-	{ "reindex", 'R', 0, G_OPTION_ARG_NONE, &reindex, 
+static GMainLoop    *main_loop;
+ 
+static gint          verbosity = -1;
+static gboolean      reindex;
+
+static GOptionEntry  entries[] = {
+	{ "verbosity", 'v', 0, 
+	  G_OPTION_ARG_INT, &verbosity, 
+	  N_("Logging, 0 = errors only, "
+	     "1 = minimal, 2 = detailed and 3 = debug (default = 0)"), 
+	  NULL },
+	{ "reindex", 'r', 0, 
+          G_OPTION_ARG_NONE, &reindex, 
 	  N_("Force a re-index of all content"), 
-	  NULL 
-	},
-	{ "verbosity", 'v', 0, G_OPTION_ARG_INT, &verbosity, 
-	  N_("Value that controls the level of logging. Valid values "
-	     "are 0=errors, 1=minimal, 2=detailed, 3=debug"), 
-	  N_("VALUE")
-	},
+	  NULL },
 	{ NULL }
 };
 
@@ -157,6 +157,10 @@
 
 	tracker_db_manager_init (FALSE, data_dir, user_data_dir, sys_tmp_dir);
 
+        if (reindex) {
+                tracker_db_manager_set_up_databases (TRUE);
+        }
+
 	g_free (data_dir);
 	g_free (user_data_dir);
 	g_free (sys_tmp_dir);
@@ -178,8 +182,6 @@
 	TrackerIndexer *indexer;
 	GOptionContext *context;
 	GError	       *error = NULL;
-	gchar	       *summary;
-	gchar	       *example;
         gchar          *filename;
 
 	g_type_init ();
@@ -199,29 +201,11 @@
 	/* Translators: this messagge will apper immediately after the
 	 * usage string - Usage: COMMAND <THIS_MESSAGE>
 	 */
-	context = g_option_context_new (_("- start the tracker daemon"));
-	example = g_strconcat ("-i ", _("DIRECTORY"), 
-			       "-i ", _("DIRECTORY"),
-			       "-e ", _("DIRECTORY"), 
-			       "-e ", _("DIRECTORY"),
-			       NULL);
-
-	/* Translators: this message will appear after the usage
-	 * string and before the list of options, showing an usage
-	 * example.
-	 */
-	summary = g_strdup_printf (_("To include or exclude multiple directories "
-				     "at the same time, join multiple options like:\n"
-				     "\n"
-				     "\t%s"),
-				   example);
+	context = g_option_context_new (_("- start the tracker indexer"));
 
-	g_option_context_set_summary (context, summary);
 	g_option_context_add_main_entries (context, entries, NULL);
 	g_option_context_parse (context, &argc, &argv, &error);
 	g_option_context_free (context);
-	g_free (summary);
-	g_free (example);
 
 	g_print ("\n" ABOUT "\n" LICENSE "\n");
 	g_print ("Initializing tracker-indexer...\n");
@@ -271,7 +255,7 @@
                            str ? str : "no error given");
         }
 
-	indexer = tracker_indexer_new (reindex);
+	indexer = tracker_indexer_new ();
 
 	/* Make Tracker available for introspection */
 	if (!tracker_dbus_register_object (G_OBJECT (indexer))) {

Modified: branches/xesam-support/tests/Makefile.am
==============================================================================
--- branches/xesam-support/tests/Makefile.am	(original)
+++ branches/xesam-support/tests/Makefile.am	Tue Jun 17 15:58:26 2008
@@ -1,3 +1,3 @@
 include $(top_srcdir)/Makefile.decl
 
-SUBDIRS = common libtracker-common trackerd
+SUBDIRS = common libtracker-common trackerd scripts



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]