Am 04.12.2014 um 23:29 schrieb Laurent Bigonville:
> Package: release.debian.org
> Severity: normal
> User: release.debian....@packages.debian.org
> Usertags: unblock
> 
> Dear release team,
> 
> tracker 1.2.4-1 is in unstable for 27days now, but no unblock request
> was made.
> 
> Talking to Michael Biebl today, he seems to think that it might be a
> good idea to have this version in jessie.

Nod, it contains only bug fixes, translation updates and test-suite
changes. The test-suite changes are not relevant, so have been filtered out.

> The attached patch has been generated with the following command:
> debdiff tracker_1.2.2-2.dsc tracker_1.2.4-1.dsc|filterdiff -x '*/docs/*' -x 
> '*/tests/*' -x '*/po/*' -x '*/build-aux/*' -x '*/configure' -x '*/aclocal.m4'

Thanks for the unblock request, Bigon.

The diff is unfortunately bigger then intendend, since it contains
the valac generated src/libtracker-data/tracker-sparql-query.[ch] files,
so contains a lot of noise.
Attached is an updated, filtered diff.

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/NEWS b/NEWS
index 2f6fc50..11605f2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,39 @@
+
+NEW in 1.2.4: 2014-11-06
+========================
+
+  * Fixes: GB#739237, Ownership reference not added in tracker-file-notifier.c
+
+Translations:
+
+  * Updated hu: Gábor Kelemen, Gabor Kelemen
+
+
+NEW in 1.2.3: 2014-10-17
+========================
+
+  * Fixes: GB#737768, fs: TrackerCrawler can crash due to invalid container pointers
+  * Fixes: GB#738522, libtracker-data: Guard against failure to create a FTS update statement
+  * Fixes: GB#738450, libtracker-data: Guard against failure to open the database
+  * libtracker-miner: _NO_STAT breaks in FileNotifier without a GFileInfo
+  * libtracker-miner: Handle multiple nfo:belongsToContainer properties to 1 nie:url
+  * tracker-writeback: Remove broken code to set file attributes
+  * functional-tests: Clean up writebacktest base class
+  * functional-tests: Clean up minertest base class
+  * functional-tests: Remove IgnoreNextUpdate wrapper, nobody should be using this
+  * functional-tests: Remove all remaining 'wait for miner to be idle' calls
+  * functional-tests: Allow waiting on a specific property, and fix tests that need this
+  * functional-tests: Await resource addition / removal properly in 300, 310, 600
+  * functional-tests: Improve the wait-for-change code in helpers.StoreHelper
+  * functional-tests: Partially fix writeback tests
+
+Translations:
+
+  * Updated it: Milo Casagrande
+  * Updated sr: Мирослав Николић
+  * Updated sr@latin: Мирослав Николић, Miroslav Nikolić
+
+
 NEW in 1.2.2 - 2014-09-24
 =========================
 
diff --git a/configure.ac b/configure.ac
index 389cff3..26f1838 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,8 +13,8 @@ AC_PREREQ([2.64])
 # set TRACKER_BINARY_AGE and TRACKER_INTERFACE_AGE to 0.
 m4_define([tracker_major_version], [1])
 m4_define([tracker_minor_version], [2])
-m4_define([tracker_micro_version], [2])
-m4_define([tracker_interface_age], [0])
+m4_define([tracker_micro_version], [4])
+m4_define([tracker_interface_age], [2])
 m4_define([tracker_binary_age],
           [m4_eval(100 * tracker_minor_version + tracker_micro_version)])
 m4_define([tracker_version],
diff --git a/po/hu.po b/po/hu.po
index 1beeb84..72a2db6 100644
diff --git a/po/it.po b/po/it.po
index 2789098..b9d86df 100644
diff --git a/po/sr.po b/po/sr.po
index 22b175b..a6f679c 100644
diff --git a/po/s...@latin.po b/po/s...@latin.po
index d80ee6e..e4e89b4 100644
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 62dffa4..12903bf 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -937,6 +937,7 @@ open_database (TrackerDBInterface  *db_interface,
                GError             **error)
 {
 	int mode;
+	int result;
 
 	g_assert (db_interface->filename != NULL);
 
@@ -946,11 +947,15 @@ open_database (TrackerDBInterface  *db_interface,
 		mode = SQLITE_OPEN_READONLY;
 	}
 
-	if (sqlite3_open_v2 (db_interface->filename, &db_interface->db, mode | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
+	result = sqlite3_open_v2 (db_interface->filename, &db_interface->db, mode | SQLITE_OPEN_NOMUTEX, NULL);
+	if (result != SQLITE_OK) {
+		const gchar *str;
+
+		str = sqlite3_errstr (result);
 		g_set_error (error,
 		             TRACKER_DB_INTERFACE_ERROR,
 		             TRACKER_DB_OPEN_ERROR,
-		             "Could not open sqlite3 database:'%s'", db_interface->filename);
+		             "Could not open sqlite3 database:'%s': %s", db_interface->filename, str);
 		return;
 	} else {
 		g_message ("Opened sqlite3 database:'%s'", db_interface->filename);
@@ -1212,8 +1217,17 @@ tracker_db_interface_sqlite_fts_update_text (TrackerDBInterface  *db_interface,
 							      TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE,
 							      &error,
 							      "DELETE FROM fts WHERE docid=?");
-		tracker_db_statement_bind_int (stmt, 0, id);
 
+		if (!stmt || error) {
+			if (error) {
+				g_warning ("Could not create FTS update statement: %s",
+				           error->message);
+				g_error_free (error);
+			}
+			return FALSE;
+		}
+
+		tracker_db_statement_bind_int (stmt, 0, id);
 		tracker_db_statement_execute (stmt, &error);
 		g_object_unref (stmt);
 
@@ -2334,6 +2348,7 @@ void
 tracker_db_statement_execute (TrackerDBStatement  *stmt,
                               GError             **error)
 {
+	g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
 	g_return_if_fail (!stmt->stmt_is_sunk);
 
 	execute_stmt (stmt->db_interface, stmt->stmt, NULL, error);
@@ -2343,6 +2358,7 @@ TrackerDBCursor *
 tracker_db_statement_start_cursor (TrackerDBStatement  *stmt,
                                    GError             **error)
 {
+	g_return_val_if_fail (TRACKER_IS_DB_STATEMENT (stmt), NULL);
 	g_return_val_if_fail (!stmt->stmt_is_sunk, NULL);
 
 	return tracker_db_cursor_sqlite_new (stmt->stmt, stmt, NULL, 0, NULL, 0, FALSE);
@@ -2357,6 +2373,7 @@ tracker_db_statement_start_sparql_cursor (TrackerDBStatement   *stmt,
                                           gboolean              threadsafe,
                                           GError              **error)
 {
+	g_return_val_if_fail (TRACKER_IS_DB_STATEMENT (stmt), NULL);
 	g_return_val_if_fail (!stmt->stmt_is_sunk, NULL);
 
 	return tracker_db_cursor_sqlite_new (stmt->stmt, stmt, types, n_types, variable_names, n_variable_names, threadsafe);
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index b84103d..2430263 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -500,6 +500,10 @@ public class Tracker.Sparql.Query : Object {
 
 	DBStatement prepare_for_exec (string sql) throws DBInterfaceError, Sparql.Error, DateError {
 		var iface = DBManager.get_db_interface ();
+		if (iface == null) {
+			throw new DBInterfaceError.OPEN_ERROR ("Error opening database");
+		}
+
 		var stmt = iface.create_statement (no_cache ? DBStatementCacheType.NONE : DBStatementCacheType.SELECT, "%s", sql);
 
 		// set literals specified in query
diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c
index aaeab7f..36a1193 100644
--- a/src/libtracker-miner/tracker-crawler.c
+++ b/src/libtracker-miner/tracker-crawler.c
@@ -489,6 +489,17 @@ directory_root_info_new (GFile                 *file,
 		allow_stat = FALSE;
 	}
 
+	/* NOTE: GFileInfo is ABSOLUTELY required here, without it the
+	 * TrackerFileNotifier will think that top level roots have
+	 * been deleted because the GFileInfo GQuark does not exist.
+	 *
+	 * This is seen easily by mounting a removable device,
+	 * indexing, then removing, then re-inserting that same
+	 * device.
+	 *
+	 * The check is done later in the TrackerFileNotifier by
+	 * looking up the qdata that we set in both conditions below.
+	 */
 	if (allow_stat && file_attributes) {
 		GFileInfo *file_info;
 		GFileQueryInfoFlags file_flags;
@@ -504,6 +515,30 @@ directory_root_info_new (GFile                 *file,
 		                         file_info_quark,
 		                         file_info,
 		                         (GDestroyNotify) g_object_unref);
+	} else {
+		GFileInfo *file_info;
+		gchar *basename;
+
+		file_info = g_file_info_new ();
+		g_file_info_set_file_type (file_info, G_FILE_TYPE_DIRECTORY);
+
+		basename = g_file_get_basename (file);
+		g_file_info_set_name (file_info, basename);
+		g_free (basename);
+
+		/* Only thing missing is mtime, we can't know this.
+		 * Not setting it means 0 is assumed, but if we set it
+		 * to 'now' then the state machines above us will
+		 * assume the directory is always newer when it may
+		 * not be.
+		 */
+
+		g_file_info_set_content_type (file_info, "inode/directory");
+
+		g_object_set_qdata_full (G_OBJECT (file),
+		                         file_info_quark,
+		                         file_info,
+		                         (GDestroyNotify) g_object_unref);
 	}
 
 	/* Fill in the processing info for the root node */
@@ -729,7 +764,7 @@ data_provider_data_process (DataProviderData *dpd)
 		children = g_list_prepend (children, child_data->child);
 	}
 
-	g_signal_emit (crawler, signals[CHECK_DIRECTORY_CONTENTS], 0, dpd->dir_info->node->data, children, &use);
+	g_signal_emit (crawler, signals[CHECK_DIRECTORY_CONTENTS], 0, dpd->dir_file, children, &use);
 	g_list_free (children);
 
 	if (!use) {
@@ -747,7 +782,7 @@ data_provider_data_add (DataProviderData *dpd)
 	GSList *l;
 
 	crawler = dpd->crawler;
-	parent = dpd->dir_info->node->data;
+	parent = dpd->dir_file;
 
 	for (l = dpd->files; l; l = l->next) {
 		GFileInfo *info;
@@ -818,11 +853,9 @@ data_provider_end_cb (GObject      *object,
 
 	if (error) {
 		if (!cancelled) {
-			GFile *parent;
 			gchar *uri;
 
-			parent = dpd->dir_info->node->data;
-			uri = g_file_get_uri (parent);
+			uri = g_file_get_uri (dpd->dir_file);
 
 			g_warning ("Could not end data provider for container / directory '%s', %s",
 			           uri, error ? error->message : "no error given");
@@ -912,12 +945,10 @@ enumerate_next_cb (GObject      *object,
 			/* condition a) */
 
 			if (!cancelled) {
-				GFile *parent;
 				gchar *uri;
 
 				/* condition b) */
-				parent = dpd->dir_info->node->data;
-				uri = g_file_get_uri (parent);
+				uri = g_file_get_uri (dpd->dir_file);
 				g_warning ("Could not enumerate next item in container / directory '%s', %s",
 				           uri, error ? error->message : "no error given");
 				g_free (uri);
@@ -963,11 +994,9 @@ data_provider_begin_cb (GObject      *object,
 
 	if (!dpd->enumerator) {
 		if (error && !cancelled) {
-			GFile *parent;
 			gchar *uri;
 
-			parent = dpd->dir_info->node->data;
-			uri = g_file_get_uri (parent);
+			uri = g_file_get_uri (dpd->dir_file);
 
 			g_warning ("Could not enumerate container / directory '%s', %s",
 			           uri, error ? error->message : "no error given");
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 77b21f7..af89a28 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -158,7 +158,7 @@ root_data_new (TrackerFileNotifier *notifier,
 	data = g_new0 (RootData, 1);
 	data->root = g_object_ref (file);
 	data->pending_dirs = g_queue_new ();
-	data->query_files = g_ptr_array_new ();
+	data->query_files = g_ptr_array_new_with_free_func (g_object_unref);
 	data->updated_dirs = g_ptr_array_new ();
 	data->flags = flags;
 
@@ -424,7 +424,7 @@ file_notifier_add_node_foreach (GNode    *node,
 
 		if (depth != 0 || file == priv->current_index_root->root)
 			g_ptr_array_add (priv->current_index_root->query_files,
-					 canonical);
+					 g_object_ref (canonical));
 	}
 
 	return FALSE;
@@ -542,7 +542,20 @@ sparql_contents_check_deleted (TrackerFileNotifier *notifier,
 	priv = notifier->priv;
 
 	while (tracker_sparql_cursor_next (cursor, NULL, NULL)) {
-		file = g_file_new_for_uri (tracker_sparql_cursor_get_string (cursor, 0, NULL));
+		const gchar *uri;
+
+		/* Sometimes URI can be NULL when nie:url and
+		 * nfo:belongsToContainer does not have a strictly 1:1
+		 * relationship, e.g. data containers where there is
+		 * only one nie:url but many nfo:belongsToContainer
+		 * cases.
+		 */
+		uri = tracker_sparql_cursor_get_string (cursor, 0, NULL);
+		if (!uri) {
+			continue;
+		}
+
+		file = g_file_new_for_uri (uri);
 		iri = tracker_sparql_cursor_get_string (cursor, 1, NULL);
 
 		if (!tracker_file_system_peek_file (priv->file_system, file)) {
diff --git a/src/tracker-writeback/tracker-writeback-file.c b/src/tracker-writeback/tracker-writeback-file.c
index f00d668..60fc250 100644
--- a/src/tracker-writeback/tracker-writeback-file.c
+++ b/src/tracker-writeback/tracker-writeback-file.c
@@ -257,18 +257,12 @@ tracker_writeback_file_update_metadata (TrackerWriteback         *writeback,
 		/* Delete the temporary file and preserve original */
 		g_file_delete (tmp_file, NULL, NULL);
 	} else {
-		GError *m_error = NULL;
-		/* Move back the modified file to the original location */
+		/* Move back the modified file to the original location. Correct UNIX
+		 * mode has been set for tmp_file in create_temporary_file() already.
+		 */
 		g_file_move (tmp_file, file,
 		             G_FILE_COPY_OVERWRITE,
 		             NULL, NULL, NULL, NULL);
-		/* Set file attributes on tmp_file using file_info of original file */
-		g_file_set_attributes_from_info (tmp_file, file_info, 0, NULL, &m_error);
-		if (m_error) {
-			g_warning ("Can't restore permissions of original file for %s",
-			           row[0]);
-			g_error_free (m_error);
-		}
 	}
 
 	g_object_unref (file_info);
diff --git a/tests/functional-tests/300-miner-basic-ops.py b/tests/functional-tests/300-miner-basic-ops.py
index c887560..9725997 100755
diff --git a/tests/functional-tests/310-fts-indexing.py b/tests/functional-tests/310-fts-indexing.py
index 99db45d..33e2adf 100755
diff --git a/tests/functional-tests/500-writeback.py b/tests/functional-tests/500-writeback.py
index cd144a7..cdd2b06 100755
diff --git a/tests/functional-tests/501-writeback-details.py b/tests/functional-tests/501-writeback-details.py
index 62da5fc..856f698 100755
diff --git a/tests/functional-tests/600-applications-camera.py b/tests/functional-tests/600-applications-camera.py
index 126ebd7..f793665 100755
diff --git a/tests/functional-tests/601-applications-sync.py b/tests/functional-tests/601-applications-sync.py
index 2dc753c..26dad95 100755
diff --git a/tests/functional-tests/common/utils/extractor.py b/tests/functional-tests/common/utils/extractor.py
index 183a913..8dd0560 100644
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index 16afa82..494deba 100644
diff --git a/tests/functional-tests/common/utils/minertest.py b/tests/functional-tests/common/utils/minertest.py
index 7111d86..113eca9 100644
diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/common/utils/system.py
index 8759750..16540c7 100644
diff --git a/tests/functional-tests/common/utils/writebacktest.py b/tests/functional-tests/common/utils/writebacktest.py
index 927dad3..ce6f2c7 100644

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to