[tracker/rss-enclosures] libtracker-data: NB#184823, Unsupported ontology change prevent tracker for booting



commit 942026d59530a1759a15e0160c094694f9f5bd26
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Aug 11 15:44:28 2010 +0200

    libtracker-data: NB#184823, Unsupported ontology change prevent tracker for booting

 data/ontologies/89-mtp.ontology            |    2 +-
 src/libtracker-data/tracker-data-manager.c |    6 +++---
 src/libtracker-data/tracker-db-manager.c   |    9 +++++++--
 src/libtracker-data/tracker-db-manager.h   |    1 +
 src/tracker-control/tracker-control.c      |    2 +-
 5 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/data/ontologies/89-mtp.ontology b/data/ontologies/89-mtp.ontology
index 2da81bf..3bc31b8 100644
--- a/data/ontologies/89-mtp.ontology
+++ b/data/ontologies/89-mtp.ontology
@@ -11,7 +11,7 @@
 
 mtp: a tracker:Namespace, tracker:Ontology ;
 	tracker:prefix "mtp" ;
-	nao:lastModified "2010-08-05T13:00:00Z" .
+	nao:lastModified "2010-08-11T16:00:00Z" .
 
 #
 # This ontology "decorates" nmm and nfo to include properties required
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 232e55b..c568808 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2684,7 +2684,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 	GList *sorted = NULL, *l;
 	const gchar *env_path;
 	gint max_id = 0;
-	gboolean read_only;
+	gboolean read_only, needed_reindex = FALSE;
 
 	tracker_data_update_init ();
 
@@ -2704,7 +2704,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 	read_journal = FALSE;
 
-	if (!tracker_db_manager_init (flags, &is_first_time_index, TRUE)) {
+	if (!tracker_db_manager_init (flags, &is_first_time_index, &needed_reindex, TRUE)) {
 		return FALSE;
 	}
 
@@ -2718,7 +2718,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 	iface = tracker_db_manager_get_db_interface ();
 
-	if (journal_check && is_first_time_index) {
+	if (journal_check && is_first_time_index && !needed_reindex) {
 		if (tracker_db_journal_reader_init (NULL)) {
 			if (tracker_db_journal_reader_next (NULL)) {
 				/* journal with at least one valid transaction
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 86b7109..37ad10f 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -56,7 +56,7 @@
 #define TRACKER_DB_PAGE_SIZE_DONT_SET -1
 
 /* Set current database version we are working with */
-#define TRACKER_DB_VERSION_NOW        TRACKER_DB_VERSION_0_9_15
+#define TRACKER_DB_VERSION_NOW        TRACKER_DB_VERSION_0_9_16
 #define TRACKER_DB_VERSION_FILE       "db-version.txt"
 
 #define IN_USE_FILENAME               ".meta.isrunning"
@@ -89,7 +89,8 @@ typedef enum {
 	TRACKER_DB_VERSION_0_8_0,   /* stable release */
 	TRACKER_DB_VERSION_0_9_0,   /* unstable release */
 	TRACKER_DB_VERSION_0_9_8,   /* affiliation cardinality + volumes */
-	TRACKER_DB_VERSION_0_9_15   /* mtp:hidden */
+	TRACKER_DB_VERSION_0_9_15,  /* mtp:hidden */
+	TRACKER_DB_VERSION_0_9_16   /* Fix for NB#184823 */
 } TrackerDBVersion;
 
 typedef struct {
@@ -653,6 +654,7 @@ free_thread_interface (gpointer data)
 gboolean
 tracker_db_manager_init (TrackerDBManagerFlags  flags,
                          gboolean              *first_time,
+                         gboolean              *needed_reindex,
                          gboolean               shared_cache)
 {
 	GType               etype;
@@ -743,6 +745,9 @@ tracker_db_manager_init (TrackerDBManagerFlags  flags,
 	}
 
 	if (need_reindex) {
+		if (needed_reindex) {
+			*needed_reindex = TRUE;
+		}
 		db_set_version ();
 	}
 
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index 635f4f5..dd9cc56 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -49,6 +49,7 @@ typedef enum {
 GType               tracker_db_get_type                       (void) G_GNUC_CONST;
 gboolean            tracker_db_manager_init                   (TrackerDBManagerFlags  flags,
                                                                gboolean              *first_time,
+                                                               gboolean              *needed_reindex,
                                                                gboolean               shared_cache);
 void                tracker_db_manager_shutdown               (void);
 void                tracker_db_manager_remove_all             (gboolean               rm_journal);
diff --git a/src/tracker-control/tracker-control.c b/src/tracker-control/tracker-control.c
index 3efe871..04fb4a8 100644
--- a/src/tracker-control/tracker-control.c
+++ b/src/tracker-control/tracker-control.c
@@ -431,7 +431,7 @@ main (int argc, char **argv)
 		g_object_unref (db_config);
 
 		/* Clean up */
-		if (!tracker_db_manager_init (TRACKER_DB_MANAGER_REMOVE_ALL, NULL, FALSE)) {
+		if (!tracker_db_manager_init (TRACKER_DB_MANAGER_REMOVE_ALL, NULL, NULL, FALSE)) {
 			return EXIT_FAILURE;
 		}
 



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