[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Tracker] [PATCH] fixing some bad misbehavior
- From: "Marcus Fritzsch" <fritschy googlemail com>
- To: jamie <jamiemcc blueyonder co uk>
- Cc: Tracker-List <tracker-list gnome org>
- Subject: Re: [Tracker] [PATCH] fixing some bad misbehavior
- Date: Wed, 25 Jul 2007 00:21:09 +0200
Hi,
On 7/24/07, jamie <jamiemcc blueyonder co uk> wrote:
On Tue, 2007-07-24 at 16:17 +0200, Marcus Fritzsch wrote:
> Hi there,
>
> as the new crawling is there I wanted to try it for my NFS exports
> over the net, the problem: it did not worked, the crawled directories
> were on the crawled directories list, but were never checked on start
> - this is one part.
you just need to check the crawled directories are not sub directories
of the watched ones and then do as you have coded.
Right! Did not thought of that. And, one step further, is it a problem
if a watched directory is a sub directory of a crawled one?
The check is located in sanity_check_option_values ().
> The other part: when removing $HOME from WatchDirectoryRoots (also,
> this 'disables' the t-p preferences checkbox), $HOME is added to the
> watched directories if this list is empty (and so is indexed later
> on).
we default to home dir if no watches set - this has been the behaviour
since the beginning so not sure if I want to change it
Hmm, yes, but then the preferences switch for indexing and watching of
the $HOME is pretty useless, or do I missed something here?
Marcus
diff --git a/src/trackerd/trackerd.c b/src/trackerd/trackerd.c
index a85fcf2..3299b7d 100644
--- a/src/trackerd/trackerd.c
+++ b/src/trackerd/trackerd.c
@@ -1066,6 +1066,14 @@ process_files_thread (void)
tracker->dir_list = NULL;
}
+ g_slist_foreach (tracker->crawl_directory_list, (GFunc) schedule_dir_check, db_con);
+
+ if (tracker->crawl_directory_list) {
+ g_slist_foreach (tracker->crawl_directory_list, (GFunc) g_free, NULL);
+ g_slist_free (tracker->crawl_directory_list);
+ tracker->crawl_directory_list = NULL;
+ }
+
g_slist_foreach (tracker->watch_directory_roots_list, (GFunc) schedule_dir_check, db_con);
if (tracker->dir_list) {
@@ -2003,6 +2007,30 @@ sanity_check_option_values ()
}
if (tracker->crawl_directory_list) {
+ GSList * cur, * crawl_dirs;
+
+ crawl_dirs = NULL;
+
+ /* check for crawling dirs not being subdirs of watched
+ * dirs */
+ for (cur = tracker->crawl_directory_list; cur; cur = g_slist_next (cur)) {
+ GSList * tmp = NULL;
+
+ for (tmp = tracker->watch_directory_roots_list; tmp; tmp = g_slist_next (tmp)) {
+ if (g_str_has_prefix ((const gchar *) cur->data, (const gchar *) tmp->data)) {
+ break;
+ }
+ }
+
+ if (! tmp)
+ crawl_dirs = g_slist_prepend (crawl_dirs, g_strdup (cur->data));
+ }
+
+ /* clean up temps */
+ g_slist_foreach (tracker->crawl_directory_list, (GFunc) g_free, NULL);
+ g_slist_free (tracker->crawl_directory_list);
+
+ tracker->crawl_directory_list = crawl_dirs;
tracker_log ("Setting crawl directory roots to:");
for (l = tracker->crawl_directory_list; l; l=l->next) {
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]