|
|
464bba |
From df26e2e0c3e36ed02f87e249bee788d54886e9dd Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Mon, 26 Dec 2016 21:49:44 +0100
|
|
|
464bba |
Subject: [PATCH 1/8] libtracker-miner: Fully stop TrackerFileNotifier
|
|
|
464bba |
operations on errors
|
|
|
464bba |
|
|
|
464bba |
It oddly tried to just keep going, which may result in spurious deletes
|
|
|
464bba |
or partial inserts. Sounds better to just drop the ball on the directory
|
|
|
464bba |
at hand, it should be correctly indexed eventually.
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-file-notifier.c | 22 +++++++++++++---------
|
|
|
464bba |
1 file changed, 13 insertions(+), 9 deletions(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
index 4d3ec2467..5b1abe095 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
@@ -779,9 +779,11 @@ sparql_contents_query_cb (GObject *object,
|
|
|
464bba |
cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object),
|
|
|
464bba |
result, &error);
|
|
|
464bba |
if (error) {
|
|
|
464bba |
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
464bba |
- goto out;
|
|
|
464bba |
- g_warning ("Could not query directory contents: %s\n", error->message);
|
|
|
464bba |
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
|
|
464bba |
+ g_warning ("Could not query directory contents: %s\n", error->message);
|
|
|
464bba |
+ finish_current_directory (notifier, TRUE);
|
|
|
464bba |
+ }
|
|
|
464bba |
+ goto out;
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
notifier = user_data;
|
|
|
464bba |
@@ -865,17 +867,19 @@ sparql_files_query_cb (GObject *object,
|
|
|
464bba |
GFile *directory;
|
|
|
464bba |
guint flags;
|
|
|
464bba |
|
|
|
464bba |
+ notifier = data->notifier;
|
|
|
464bba |
+ priv = notifier->priv;
|
|
|
464bba |
+
|
|
|
464bba |
cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object),
|
|
|
464bba |
result, &error);
|
|
|
464bba |
if (error) {
|
|
|
464bba |
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
464bba |
- goto out;
|
|
|
464bba |
- g_warning ("Could not query indexed files: %s\n", error->message);
|
|
|
464bba |
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
|
|
464bba |
+ g_warning ("Could not query indexed files: %s\n", error->message);
|
|
|
464bba |
+ finish_current_directory (notifier, TRUE);
|
|
|
464bba |
+ }
|
|
|
464bba |
+ goto out;
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
- notifier = data->notifier;
|
|
|
464bba |
- priv = notifier->priv;
|
|
|
464bba |
-
|
|
|
464bba |
if (cursor) {
|
|
|
464bba |
sparql_files_query_populate (notifier, cursor, TRUE);
|
|
|
464bba |
g_object_unref (cursor);
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From 1f5ac7a8c3db62d23c0148429905eeaf5c45b36d Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Sun, 16 Apr 2017 11:58:00 -0300
|
|
|
464bba |
Subject: [PATCH 2/8] libtracker-miner: Shuffle refcount handling when queueing
|
|
|
464bba |
back a file
|
|
|
464bba |
|
|
|
464bba |
The file might or might not be inserted to the queue, which meant that
|
|
|
464bba |
the extra ref created outside the call might never dropped if the file
|
|
|
464bba |
didn't end up inserted again. Fix this by doing the refcount increase
|
|
|
464bba |
when actually inserting the file back in the queue.
|
|
|
464bba |
|
|
|
464bba |
Reported by Jose M. Arroyo <jose.m.arroyo.se@gmail.com>.
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-miner-fs.c | 24 +++++++-----------------
|
|
|
464bba |
1 file changed, 7 insertions(+), 17 deletions(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
index 02b4a4755..15ac82f4d 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
@@ -2109,11 +2109,10 @@ should_wait (TrackerMinerFS *fs,
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
static gboolean
|
|
|
464bba |
-item_reenqueue_full (TrackerMinerFS *fs,
|
|
|
464bba |
- TrackerPriorityQueue *item_queue,
|
|
|
464bba |
- GFile *queue_file,
|
|
|
464bba |
- gpointer queue_data,
|
|
|
464bba |
- gint priority)
|
|
|
464bba |
+item_enqueue_again (TrackerMinerFS *fs,
|
|
|
464bba |
+ TrackerPriorityQueue *item_queue,
|
|
|
464bba |
+ GFile *queue_file,
|
|
|
464bba |
+ gint priority)
|
|
|
464bba |
{
|
|
|
464bba |
gint reentry_counter;
|
|
|
464bba |
gchar *uri;
|
|
|
464bba |
@@ -2126,7 +2125,7 @@ item_reenqueue_full (TrackerMinerFS *fs,
|
|
|
464bba |
g_object_set_qdata (G_OBJECT (queue_file),
|
|
|
464bba |
fs->priv->quark_reentry_counter,
|
|
|
464bba |
GINT_TO_POINTER (reentry_counter + 1));
|
|
|
464bba |
- tracker_priority_queue_add (item_queue, queue_data, priority);
|
|
|
464bba |
+ tracker_priority_queue_add (item_queue, g_object_ref (queue_file), priority);
|
|
|
464bba |
|
|
|
464bba |
should_wait = TRUE;
|
|
|
464bba |
} else {
|
|
|
464bba |
@@ -2147,15 +2146,6 @@ item_reenqueue_full (TrackerMinerFS *fs,
|
|
|
464bba |
return should_wait;
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
-static gboolean
|
|
|
464bba |
-item_reenqueue (TrackerMinerFS *fs,
|
|
|
464bba |
- TrackerPriorityQueue *item_queue,
|
|
|
464bba |
- GFile *queue_file,
|
|
|
464bba |
- gint priority)
|
|
|
464bba |
-{
|
|
|
464bba |
- return item_reenqueue_full (fs, item_queue, queue_file, queue_file, priority);
|
|
|
464bba |
-}
|
|
|
464bba |
-
|
|
|
464bba |
static QueueState
|
|
|
464bba |
item_queue_get_next_file (TrackerMinerFS *fs,
|
|
|
464bba |
GFile **file,
|
|
|
464bba |
@@ -2601,8 +2591,8 @@ item_queue_handlers_cb (gpointer user_data)
|
|
|
464bba |
* ensured, tasks are inserted at a higher priority so they
|
|
|
464bba |
* are processed promptly anyway.
|
|
|
464bba |
*/
|
|
|
464bba |
- item_reenqueue (fs, item_queue, g_object_ref (parent), priority - 1);
|
|
|
464bba |
- item_reenqueue (fs, item_queue, g_object_ref (file), priority);
|
|
|
464bba |
+ item_enqueue_again (fs, item_queue, parent, priority - 1);
|
|
|
464bba |
+ item_enqueue_again (fs, item_queue, file, priority);
|
|
|
464bba |
|
|
|
464bba |
keep_processing = TRUE;
|
|
|
464bba |
}
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From cc917a0c029ebc46a1fbca5d73a9bd67b27e2e57 Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Thu, 6 Jul 2017 11:19:17 +0200
|
|
|
464bba |
Subject: [PATCH 3/8] libtracker-miner: Fix warnings if move ops happened
|
|
|
464bba |
during initial crawling
|
|
|
464bba |
|
|
|
464bba |
The checks to notify about indexing having finished on TrackerIndexingTree
|
|
|
464bba |
roots were mistaking ItemMovedData* with GFile*, which lead to warnings.
|
|
|
464bba |
This should be harmless, the signal might be possibly emitted before the
|
|
|
464bba |
move op is dispatched, that's all.
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-miner-fs.c | 11 ++++++++++-
|
|
|
464bba |
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
index 15ac82f4d..baa2c9a7a 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
@@ -1110,6 +1110,15 @@ miner_resumed (TrackerMiner *miner)
|
|
|
464bba |
}
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
+static gboolean
|
|
|
464bba |
+item_moved_data_has_prefix (gpointer data,
|
|
|
464bba |
+ gpointer user_data)
|
|
|
464bba |
+{
|
|
|
464bba |
+ ItemMovedData *moved_item = data;
|
|
|
464bba |
+ GFile *prefix = user_data;
|
|
|
464bba |
+
|
|
|
464bba |
+ return g_file_has_prefix (moved_item->file, prefix);
|
|
|
464bba |
+}
|
|
|
464bba |
|
|
|
464bba |
static void
|
|
|
464bba |
miner_ignore_next_update (TrackerMiner *miner, const GStrv urls)
|
|
|
464bba |
@@ -1165,7 +1174,7 @@ notify_roots_finished (TrackerMinerFS *fs,
|
|
|
464bba |
(tracker_priority_queue_find (fs->priv->items_created, NULL, (GEqualFunc) g_file_has_prefix, root) ||
|
|
|
464bba |
tracker_priority_queue_find (fs->priv->items_updated, NULL, (GEqualFunc) g_file_has_prefix, root) ||
|
|
|
464bba |
tracker_priority_queue_find (fs->priv->items_deleted, NULL, (GEqualFunc) g_file_has_prefix, root) ||
|
|
|
464bba |
- tracker_priority_queue_find (fs->priv->items_moved, NULL, (GEqualFunc) g_file_has_prefix, root) ||
|
|
|
464bba |
+ tracker_priority_queue_find (fs->priv->items_moved, NULL, (GEqualFunc) item_moved_data_has_prefix, root) ||
|
|
|
464bba |
tracker_priority_queue_find (fs->priv->items_writeback, NULL, (GEqualFunc) g_file_has_prefix, root))) {
|
|
|
464bba |
continue;
|
|
|
464bba |
}
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From 74ad92e34d8f58e9c8f015bf9f3173e3f738a23c Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Sun, 9 Jul 2017 19:08:54 +0200
|
|
|
464bba |
Subject: [PATCH 4/8] libtracker-miner: Ensure sparql buffer keeps flushing
|
|
|
464bba |
|
|
|
464bba |
The sparql buffer might get full again with new tasks before the
|
|
|
464bba |
update_array operation for the current batch returned. In this case
|
|
|
464bba |
nothing will kick the TrackerMinerFS again, nor the SPARQL buffer
|
|
|
464bba |
from flushing again. Fix this by just flushing again, the miner
|
|
|
464bba |
will follow as soon as the SPARQL buffer is below limits.
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-sparql-buffer.c | 8 +++++++-
|
|
|
464bba |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
|
|
|
464bba |
index 5d0be93a4..95f9c8ede 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-sparql-buffer.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
|
|
|
464bba |
@@ -246,6 +246,7 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
|
|
|
464bba |
gpointer user_data)
|
|
|
464bba |
{
|
|
|
464bba |
TrackerSparqlBufferPrivate *priv;
|
|
|
464bba |
+ TrackerSparqlBuffer *buffer;
|
|
|
464bba |
GError *global_error = NULL;
|
|
|
464bba |
GPtrArray *sparql_array_errors;
|
|
|
464bba |
UpdateArrayData *update_data;
|
|
|
464bba |
@@ -253,7 +254,8 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
|
|
|
464bba |
|
|
|
464bba |
/* Get arrays of errors and queries */
|
|
|
464bba |
update_data = user_data;
|
|
|
464bba |
- priv = TRACKER_SPARQL_BUFFER (update_data->buffer)->priv;
|
|
|
464bba |
+ buffer = TRACKER_SPARQL_BUFFER (update_data->buffer);
|
|
|
464bba |
+ priv = buffer->priv;
|
|
|
464bba |
priv->n_updates--;
|
|
|
464bba |
|
|
|
464bba |
g_debug ("(Sparql buffer) Finished array-update with %u tasks",
|
|
|
464bba |
@@ -338,6 +340,10 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
|
|
|
464bba |
if (global_error) {
|
|
|
464bba |
g_error_free (global_error);
|
|
|
464bba |
}
|
|
|
464bba |
+
|
|
|
464bba |
+ if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (buffer))) {
|
|
|
464bba |
+ tracker_sparql_buffer_flush (buffer, "SPARQL buffer limit reached (after flush)");
|
|
|
464bba |
+ }
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
static gchar *
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From 534a1839a0f6e5bb71af7bc51b79f9d9e215266b Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Mon, 25 Sep 2017 12:26:33 +0200
|
|
|
464bba |
Subject: [PATCH 5/8] libtracker-miner: Check directory updates before dropping
|
|
|
464bba |
mtime info
|
|
|
464bba |
|
|
|
464bba |
file_notifier_traverse_tree() has the side effect of deleting mtime data,
|
|
|
464bba |
as it's presumably not needed anymore, except here. Check whether the
|
|
|
464bba |
directory was updated before notifying of the files inside, so we can
|
|
|
464bba |
thoroughly check for deleted content.
|
|
|
464bba |
|
|
|
464bba |
https://bugzilla.gnome.org/show_bug.cgi?id=786132
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-file-notifier.c | 7 +++++--
|
|
|
464bba |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
index 5b1abe095..433f79524 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-file-notifier.c
|
|
|
464bba |
@@ -863,6 +863,7 @@ sparql_files_query_cb (GObject *object,
|
|
|
464bba |
TrackerFileNotifierPrivate *priv;
|
|
|
464bba |
TrackerFileNotifier *notifier;
|
|
|
464bba |
TrackerSparqlCursor *cursor;
|
|
|
464bba |
+ gboolean directory_modified;
|
|
|
464bba |
GError *error = NULL;
|
|
|
464bba |
GFile *directory;
|
|
|
464bba |
guint flags;
|
|
|
464bba |
@@ -885,13 +886,15 @@ sparql_files_query_cb (GObject *object,
|
|
|
464bba |
g_object_unref (cursor);
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
- file_notifier_traverse_tree (notifier, data->max_depth);
|
|
|
464bba |
directory = priv->current_index_root->current_dir;
|
|
|
464bba |
flags = priv->current_index_root->flags;
|
|
|
464bba |
+ directory_modified = file_notifier_is_directory_modified (notifier, directory);
|
|
|
464bba |
+
|
|
|
464bba |
+ file_notifier_traverse_tree (notifier, data->max_depth);
|
|
|
464bba |
|
|
|
464bba |
if ((flags & TRACKER_DIRECTORY_FLAG_CHECK_DELETED) != 0 ||
|
|
|
464bba |
priv->current_index_root->current_dir_content_filtered ||
|
|
|
464bba |
- file_notifier_is_directory_modified (notifier, directory)) {
|
|
|
464bba |
+ directory_modified) {
|
|
|
464bba |
/* The directory has updated its mtime, this means something
|
|
|
464bba |
* was either added or removed in the mean time. Crawling
|
|
|
464bba |
* will always find all newly added files. But still, we
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From c48c677e3a5ba0045868049e28a52c5e5e49b980 Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Mon, 25 Sep 2017 12:12:47 +0200
|
|
|
464bba |
Subject: [PATCH 6/8] libtracker-miner: Always fallback to URN query when
|
|
|
464bba |
queueing file
|
|
|
464bba |
|
|
|
464bba |
Tracker may end up with nfo:FileDataObject prior to handling monitor
|
|
|
464bba |
events. Be it leftover data from previous bugs, explicit "tracker index"
|
|
|
464bba |
calls, or data from some other application.
|
|
|
464bba |
|
|
|
464bba |
As we can't be really sure of the data consistence, always fallback to
|
|
|
464bba |
a URN query so we don't break nie:url UNIQUE constraint (inverse functional
|
|
|
464bba |
property in SPARQL parlance).
|
|
|
464bba |
|
|
|
464bba |
https://bugzilla.gnome.org/show_bug.cgi?id=786132
|
|
|
464bba |
---
|
|
|
464bba |
src/libtracker-miner/tracker-miner-fs.c | 17 ++++++++---------
|
|
|
464bba |
1 file changed, 8 insertions(+), 9 deletions(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
index baa2c9a7a..1a4af1c12 100644
|
|
|
464bba |
--- a/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
+++ b/src/libtracker-miner/tracker-miner-fs.c
|
|
|
464bba |
@@ -2821,12 +2821,11 @@ miner_fs_cache_file_urn (TrackerMinerFS *fs,
|
|
|
464bba |
static void
|
|
|
464bba |
miner_fs_queue_file (TrackerMinerFS *fs,
|
|
|
464bba |
TrackerPriorityQueue *item_queue,
|
|
|
464bba |
- GFile *file,
|
|
|
464bba |
- gboolean query_urn)
|
|
|
464bba |
+ GFile *file)
|
|
|
464bba |
{
|
|
|
464bba |
gint priority;
|
|
|
464bba |
|
|
|
464bba |
- miner_fs_cache_file_urn (fs, file, query_urn);
|
|
|
464bba |
+ miner_fs_cache_file_urn (fs, file, TRUE);
|
|
|
464bba |
priority = miner_fs_get_queue_priority (fs, file);
|
|
|
464bba |
tracker_priority_queue_add (item_queue, g_object_ref (file), priority);
|
|
|
464bba |
}
|
|
|
464bba |
@@ -2981,7 +2980,7 @@ check_item_queues (TrackerMinerFS *fs,
|
|
|
464bba |
*/
|
|
|
464bba |
g_debug (" Found matching unhandled CREATED event "
|
|
|
464bba |
"for source file, merging both events together");
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_created, other_file, FALSE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_created, other_file);
|
|
|
464bba |
|
|
|
464bba |
return FALSE;
|
|
|
464bba |
}
|
|
|
464bba |
@@ -3016,7 +3015,7 @@ file_notifier_file_created (TrackerFileNotifier *notifier,
|
|
|
464bba |
TrackerMinerFS *fs = user_data;
|
|
|
464bba |
|
|
|
464bba |
if (check_item_queues (fs, QUEUE_CREATED, file, NULL)) {
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_created, file, FALSE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_created, file);
|
|
|
464bba |
item_queue_handlers_set_up (fs);
|
|
|
464bba |
}
|
|
|
464bba |
}
|
|
|
464bba |
@@ -3039,7 +3038,7 @@ file_notifier_file_deleted (TrackerFileNotifier *notifier,
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
if (check_item_queues (fs, QUEUE_DELETED, file, NULL)) {
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_deleted, file);
|
|
|
464bba |
item_queue_handlers_set_up (fs);
|
|
|
464bba |
}
|
|
|
464bba |
}
|
|
|
464bba |
@@ -3070,7 +3069,7 @@ file_notifier_file_updated (TrackerFileNotifier *notifier,
|
|
|
464bba |
GINT_TO_POINTER (TRUE));
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_updated, file, TRUE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_updated, file);
|
|
|
464bba |
item_queue_handlers_set_up (fs);
|
|
|
464bba |
}
|
|
|
464bba |
}
|
|
|
464bba |
@@ -3416,7 +3415,7 @@ tracker_miner_fs_directory_remove_full (TrackerMinerFS *fs,
|
|
|
464bba |
* to preserve remove_full() semantics.
|
|
|
464bba |
*/
|
|
|
464bba |
trace_eq_push_tail ("DELETED", file, "on remove full");
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_deleted, file);
|
|
|
464bba |
item_queue_handlers_set_up (fs);
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
@@ -3460,7 +3459,7 @@ check_file_parents (TrackerMinerFS *fs,
|
|
|
464bba |
|
|
|
464bba |
for (p = parents; p; p = p->next) {
|
|
|
464bba |
trace_eq_push_tail ("UPDATED", p->data, "checking file parents");
|
|
|
464bba |
- miner_fs_queue_file (fs, fs->priv->items_updated, p->data, TRUE);
|
|
|
464bba |
+ miner_fs_queue_file (fs, fs->priv->items_updated, p->data);
|
|
|
464bba |
g_object_unref (p->data);
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From 9df5d3cae1c79bdb3c5f930bf665fe5d1f442547 Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Sun, 24 Sep 2017 12:04:22 +0200
|
|
|
464bba |
Subject: [PATCH 7/8] tracker-miner-fs: Explicitly ignore non-native mounts
|
|
|
464bba |
|
|
|
464bba |
tracker-miner-fs does rely in a few places to index local content
|
|
|
464bba |
exclusively. Make it explicitly ignore non-native mounts, they won't
|
|
|
464bba |
be indexed anyway, but we can spare trying to create the tracker:Volume
|
|
|
464bba |
and mount root's nfo:FileDataObject for these.
|
|
|
464bba |
|
|
|
464bba |
Fixes nie:url constraint errors and other warnings when trying to deal
|
|
|
464bba |
with those.
|
|
|
464bba |
|
|
|
464bba |
https://bugzilla.gnome.org/show_bug.cgi?id=786132
|
|
|
464bba |
---
|
|
|
464bba |
src/miners/fs/tracker-storage.c | 10 +++++++++-
|
|
|
464bba |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/miners/fs/tracker-storage.c b/src/miners/fs/tracker-storage.c
|
|
|
464bba |
index 9ec59dbfd..6114a6fd6 100644
|
|
|
464bba |
--- a/src/miners/fs/tracker-storage.c
|
|
|
464bba |
+++ b/src/miners/fs/tracker-storage.c
|
|
|
464bba |
@@ -550,8 +550,16 @@ mount_add (TrackerStorage *storage,
|
|
|
464bba |
|
|
|
464bba |
/* Get root path of the mount */
|
|
|
464bba |
root = g_mount_get_root (mount);
|
|
|
464bba |
- mount_path = g_file_get_path (root);
|
|
|
464bba |
+ if (!g_file_is_native (root)) {
|
|
|
464bba |
+ gchar *uri = g_file_get_uri (root);
|
|
|
464bba |
|
|
|
464bba |
+ g_debug ("Ignoring mount '%s', URI '%s' is not native",
|
|
|
464bba |
+ mount_name, uri);
|
|
|
464bba |
+ g_free (uri);
|
|
|
464bba |
+ return;
|
|
|
464bba |
+ }
|
|
|
464bba |
+
|
|
|
464bba |
+ mount_path = g_file_get_path (root);
|
|
|
464bba |
g_debug ("Found '%s' mounted on path '%s'",
|
|
|
464bba |
mount_name,
|
|
|
464bba |
mount_path);
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|
|
|
464bba |
|
|
|
464bba |
From 907a867cd72827d5b24d6d8474d9e76d6ff095aa Mon Sep 17 00:00:00 2001
|
|
|
464bba |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
464bba |
Date: Sun, 10 Sep 2017 17:01:26 +0200
|
|
|
464bba |
Subject: [PATCH 8/8] applications: Ignore broken symlinks
|
|
|
464bba |
|
|
|
464bba |
We still do need to query mtime from the symlink itself in order to keep
|
|
|
464bba |
filesystem accounting happy, so wait for ENOENT while doing
|
|
|
464bba |
g_key_file_load_from_file() in order to figure out we are dealing with
|
|
|
464bba |
a broken link (or a no longer existing file, which is also possible). This
|
|
|
464bba |
avoids spewing any warnings with those.
|
|
|
464bba |
|
|
|
464bba |
https://bugzilla.gnome.org/show_bug.cgi?id=786132
|
|
|
464bba |
---
|
|
|
464bba |
src/miners/apps/tracker-miner-applications.c | 34 ++++++++++++++++------------
|
|
|
464bba |
1 file changed, 20 insertions(+), 14 deletions(-)
|
|
|
464bba |
|
|
|
464bba |
diff --git a/src/miners/apps/tracker-miner-applications.c b/src/miners/apps/tracker-miner-applications.c
|
|
|
464bba |
index 749d3e4d2..a2d1f78d8 100644
|
|
|
464bba |
--- a/src/miners/apps/tracker-miner-applications.c
|
|
|
464bba |
+++ b/src/miners/apps/tracker-miner-applications.c
|
|
|
464bba |
@@ -430,8 +430,7 @@ get_desktop_key_file (GFile *file,
|
|
|
464bba |
key_file = g_key_file_new ();
|
|
|
464bba |
*type = NULL;
|
|
|
464bba |
|
|
|
464bba |
- if (!g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, NULL)) {
|
|
|
464bba |
- g_set_error (error, miner_applications_error_quark, 0, "Couldn't load desktop file:'%s'", path);
|
|
|
464bba |
+ if (!g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, error)) {
|
|
|
464bba |
g_key_file_free (key_file);
|
|
|
464bba |
g_free (path);
|
|
|
464bba |
return NULL;
|
|
|
464bba |
@@ -943,6 +942,7 @@ process_file_cb (GObject *object,
|
|
|
464bba |
ProcessApplicationData *data;
|
|
|
464bba |
GFileInfo *file_info;
|
|
|
464bba |
GError *error = NULL;
|
|
|
464bba |
+ GFileType file_type;
|
|
|
464bba |
GFile *file;
|
|
|
464bba |
|
|
|
464bba |
data = user_data;
|
|
|
464bba |
@@ -956,21 +956,27 @@ process_file_cb (GObject *object,
|
|
|
464bba |
return;
|
|
|
464bba |
}
|
|
|
464bba |
|
|
|
464bba |
- if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY) {
|
|
|
464bba |
+ file_type = g_file_info_get_file_type (file_info);
|
|
|
464bba |
+
|
|
|
464bba |
+ if (file_type == G_FILE_TYPE_DIRECTORY) {
|
|
|
464bba |
process_directory (data, file_info, &error);
|
|
|
464bba |
- } else {
|
|
|
464bba |
+ } else if (file_type == G_FILE_TYPE_REGULAR ||
|
|
|
464bba |
+ file_type == G_FILE_TYPE_SYMBOLIC_LINK) {
|
|
|
464bba |
data->key_file = get_desktop_key_file (file, &data->type, &error);
|
|
|
464bba |
if (!data->key_file) {
|
|
|
464bba |
- gchar *uri;
|
|
|
464bba |
-
|
|
|
464bba |
- uri = g_file_get_uri (file);
|
|
|
464bba |
- g_warning ("Couldn't properly parse desktop file '%s': '%s'",
|
|
|
464bba |
- uri,
|
|
|
464bba |
- error ? error->message : "unknown error");
|
|
|
464bba |
- g_free (uri);
|
|
|
464bba |
- g_clear_error (&error);
|
|
|
464bba |
-
|
|
|
464bba |
- error = g_error_new_literal (miner_applications_error_quark, 0, "File is not a key file");
|
|
|
464bba |
+ /* Ignore broken symlinks */
|
|
|
464bba |
+ if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
|
|
|
464bba |
+ gchar *uri;
|
|
|
464bba |
+
|
|
|
464bba |
+ uri = g_file_get_uri (file);
|
|
|
464bba |
+ g_warning ("Couldn't properly parse desktop file '%s': '%s'",
|
|
|
464bba |
+ uri,
|
|
|
464bba |
+ error ? error->message : "unknown error");
|
|
|
464bba |
+ g_free (uri);
|
|
|
464bba |
+ g_clear_error (&error);
|
|
|
464bba |
+
|
|
|
464bba |
+ error = g_error_new_literal (miner_applications_error_quark, 0, "File is not a key file");
|
|
|
464bba |
+ }
|
|
|
464bba |
} else if (g_key_file_get_boolean (data->key_file, GROUP_DESKTOP_ENTRY, "Hidden", NULL)) {
|
|
|
464bba |
error = g_error_new_literal (miner_applications_error_quark, 0, "Desktop file is 'hidden', not gathering metadata for it");
|
|
|
464bba |
} else {
|
|
|
464bba |
--
|
|
|
464bba |
2.14.2
|
|
|
464bba |
|