[tracker-miners] tracker-miner-fs: Explicitly ignore non-native mounts



commit e9f35b1c272d0739627deb6fa42aa8d4a804a9c1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Sep 24 12:04:22 2017 +0200

    tracker-miner-fs: Explicitly ignore non-native mounts
    
    tracker-miner-fs does rely in a few places to index local content
    exclusively. Make it explicitly ignore non-native mounts, they won't
    be indexed anyway, but we can spare trying to create the tracker:Volume
    and mount root's nfo:FileDataObject for these.
    
    Fixes nie:url constraint errors and other warnings when trying to deal
    with those.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786132

 src/miners/fs/tracker-storage.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/miners/fs/tracker-storage.c b/src/miners/fs/tracker-storage.c
index 9ec59db..6114a6f 100644
--- a/src/miners/fs/tracker-storage.c
+++ b/src/miners/fs/tracker-storage.c
@@ -550,8 +550,16 @@ mount_add (TrackerStorage *storage,
 
        /* Get root path of the mount */
        root = g_mount_get_root (mount);
-       mount_path = g_file_get_path (root);
+       if (!g_file_is_native (root)) {
+               gchar *uri = g_file_get_uri (root);
 
+               g_debug ("Ignoring mount '%s', URI '%s' is not native",
+                        mount_name, uri);
+               g_free (uri);
+               return;
+       }
+
+       mount_path = g_file_get_path (root);
        g_debug ("Found '%s' mounted on path '%s'",
                 mount_name,
                 mount_path);


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