tracker r2102 - in branches/indexer-split: . src/libtracker-common src/libtracker-db src/tracker-indexer src/tracker-indexer/modules src/trackerd tests/libtracker-common
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2102 - in branches/indexer-split: . src/libtracker-common src/libtracker-db src/tracker-indexer src/tracker-indexer/modules src/trackerd tests/libtracker-common
- Date: Tue, 19 Aug 2008 12:00:35 +0000 (UTC)
Author: mr
Date: Tue Aug 19 12:00:35 2008
New Revision: 2102
URL: http://svn.gnome.org/viewvc/tracker?rev=2102&view=rev
Log:
* src/libtracker-common/tracker-file-utils.c:
(tracker_path_list_filter_duplicates): Don't append a trailing
G_DIR_SEPARATOR_S when we return the list here. This standard is
not used in the rest of Tracker and strcmp() was failing to notice
ignored paths when checking against the config.
* src/libtracker-common/tracker-type-utils.[ch]:
* src/libtracker-db/tracker-db-manager.c:
* src/tracker-indexer/modules/evolution.c:
* src/tracker-indexer/tracker-indexer-db.c:
* src/tracker-indexer/tracker-indexer.c:
* src/tracker-indexer/tracker-metadata-utils.c:
* src/trackerd/tracker-db.c:
* src/trackerd/tracker-files.c:
* src/trackerd/tracker-metadata.c:
* src/trackerd/tracker-rdf-query.c:
* src/trackerd/tracker-xesam-query.c:
* tests/libtracker-common/tracker-type-utils-test.c: Changed all
_{uint|int|long}_to_string() functions to rename them to
_{guint|gint|glong}_to_string, to remain consistent with other
functions. Added tracker_gslist_copy_with_string_data() to copy a
list of strings. Also, changed many functions that return if an
input parameter is NULL to actually return the proper data type if
plausible since sometimes you would want to return an empty string
list from NULL (for example).
* src/trackerd/tracker-crawler.c: Make sure each directory is
checked against the NoWatchDirectoryRoots config option and that
each directory prefixed with "." is checked against the config
WatchDirectoryRoots and CrawlDirectoryRoots options to know if we
should NOT ignore those locations (by default they are). The
crawler was also very slow (taking ~68 seconds to crawl my 130k
files, so the throttle was decreased from 100 usecs to 25 usecs
with the same CPU utilisation making the crawl take ~12 seconds
instead).
* src/trackerd/tracker-processor.c: Make sure we check the
NoWatchDirectoryRoots config before blindly adding roots to be
checked to the crawler. Also print out what we are ignoring so we
know why some things might not be crawled/watched.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-common/tracker-file-utils.c
branches/indexer-split/src/libtracker-common/tracker-type-utils.c
branches/indexer-split/src/libtracker-common/tracker-type-utils.h
branches/indexer-split/src/libtracker-db/tracker-db-manager.c
branches/indexer-split/src/tracker-indexer/modules/evolution.c
branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
branches/indexer-split/src/trackerd/tracker-crawler.c
branches/indexer-split/src/trackerd/tracker-db.c
branches/indexer-split/src/trackerd/tracker-files.c
branches/indexer-split/src/trackerd/tracker-metadata.c
branches/indexer-split/src/trackerd/tracker-processor.c
branches/indexer-split/src/trackerd/tracker-rdf-query.c
branches/indexer-split/src/trackerd/tracker-xesam-query.c
branches/indexer-split/tests/libtracker-common/tracker-type-utils-test.c
Modified: branches/indexer-split/src/libtracker-common/tracker-file-utils.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-file-utils.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-file-utils.c Tue Aug 19 12:00:35 2008
@@ -619,6 +619,17 @@
}
if (should_add) {
+ gint len;
+
+ /* Don't use the trailing '/' and make sure we
+ * don't remove '/' if that is the content of
+ * the string or it is '//'.
+ */
+ len = strlen (path);
+ if (len > 2) {
+ path[len - 1] = '\0';
+ }
+
checked_roots = g_slist_prepend (checked_roots, path);
continue;
}
Modified: branches/indexer-split/src/libtracker-common/tracker-type-utils.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-type-utils.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-type-utils.c Tue Aug 19 12:00:35 2008
@@ -518,19 +518,19 @@
}
gchar *
-tracker_long_to_string (glong i)
+tracker_glong_to_string (glong i)
{
return g_strdup_printf ("%ld", i);
}
gchar *
-tracker_int_to_string (gint i)
+tracker_gint_to_string (gint i)
{
return g_strdup_printf ("%d", i);
}
gchar *
-tracker_uint_to_string (guint i)
+tracker_guint_to_string (guint i)
{
return g_strdup_printf ("%u", i);
}
@@ -551,10 +551,11 @@
tracker_string_to_uint (const gchar *s,
guint *value)
{
- unsigned long int n;
- char *end;
+ unsigned long int n;
+ gchar *end;
- g_return_val_if_fail (s != NULL && value != NULL, FALSE);
+ g_return_val_if_fail (s != NULL, FALSE);
+ g_return_val_if_fail (value != NULL, FALSE);
n = (guint) strtoul (s, &end, 10);
@@ -578,11 +579,15 @@
gchar **strv)
{
gchar **p;
- gint i = 0;
+ gint i;
- g_return_val_if_fail (str != NULL && strv != NULL, -1);
+ g_return_val_if_fail (str != NULL, -1);
- for (p = strv; *p; p++, i++) {
+ if (!strv) {
+ return -1;
+ }
+
+ for (p = strv, i = 0; *p; p++, i++) {
if (strcasecmp (*p, str) == 0) {
return i;
}
@@ -591,30 +596,6 @@
return -1;
}
-gchar **
-tracker_gslist_to_string_list (GSList *list)
-{
- GSList *l;
- gchar **strv;
- gint i = 0;
-
- g_return_val_if_fail (list != NULL, NULL);
-
- strv = g_new0 (gchar*, g_slist_length (list) + 1);
-
- for (l = list; l; l = l->next) {
- if (!l->data) {
- continue;
- }
-
- strv[i++] = g_strdup (l->data);
- }
-
- strv[i] = NULL;
-
- return strv;
-}
-
GSList *
tracker_string_list_to_gslist (gchar **strv,
gsize size)
@@ -691,19 +672,61 @@
return result;
}
+gchar **
+tracker_gslist_to_string_list (GSList *list)
+{
+ GSList *l;
+ gchar **strv;
+ gint i;
+
+ strv = g_new0 (gchar*, g_slist_length (list) + 1);
+
+ for (l = list, i = 0; l; l = l->next) {
+ if (!l->data) {
+ continue;
+ }
+
+ strv[i++] = g_strdup (l->data);
+ }
+
+ strv[i] = NULL;
+
+ return strv;
+}
+
+GSList *
+tracker_gslist_copy_with_string_data (GSList *list)
+{
+ GSList *l;
+ GSList *new_list;
+
+ if (!list) {
+ return NULL;
+ }
+
+ new_list = NULL;
+
+ for (l = list; l; l = l->next) {
+ if (!l->data) {
+ continue;
+ }
+ new_list = g_slist_prepend (new_list, g_strdup (l->data));
+ }
+
+ new_list = g_slist_reverse (new_list);
+
+ return new_list;
+}
gchar *
tracker_boolean_as_text_to_number (const gchar *value)
{
-
g_return_val_if_fail (value != NULL, NULL);
- if (strcasecmp (value, "true") == 0) {
+ if (g_ascii_strcasecmp (value, "true") == 0) {
return g_strdup ("1");
-
- } else if (strcasecmp (value, "false") == 0) {
+ } else if (g_ascii_strcasecmp (value, "false") == 0) {
return g_strdup ("0");
-
} else {
return g_strdup (value);
}
Modified: branches/indexer-split/src/libtracker-common/tracker-type-utils.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-type-utils.h (original)
+++ branches/indexer-split/src/libtracker-common/tracker-type-utils.h Tue Aug 19 12:00:35 2008
@@ -24,27 +24,32 @@
#include <glib.h>
-gchar * tracker_date_format (const gchar *time_string);
-time_t tracker_string_to_date (const gchar *time_string);
-gchar * tracker_date_to_string (time_t date_time);
-gchar * tracker_long_to_string (glong i);
-gchar * tracker_int_to_string (gint i);
-gchar * tracker_uint_to_string (guint i);
-gchar * tracker_gint32_to_string (gint32 i);
-gchar * tracker_guint32_to_string (guint32 i);
-gboolean tracker_string_to_uint (const gchar *s,
- guint *ret);
-gint tracker_string_in_string_list (const gchar *str,
- gchar **strv);
-gchar ** tracker_gslist_to_string_list (GSList *list);
-GSList * tracker_string_list_to_gslist (gchar **strv,
- gsize length);
-gchar * tracker_string_list_to_string (gchar **strv,
- gsize length,
- gchar sep);
-gchar ** tracker_string_to_string_list (const gchar *str);
+G_BEGIN_DECLS
+
+gchar * tracker_date_format (const gchar *time_string);
+time_t tracker_string_to_date (const gchar *time_string);
+gchar * tracker_date_to_string (time_t date_time);
+gchar * tracker_glong_to_string (glong i);
+gchar * tracker_gint_to_string (gint i);
+gchar * tracker_guint_to_string (guint i);
+gchar * tracker_gint32_to_string (gint32 i);
+gchar * tracker_guint32_to_string (guint32 i);
+gboolean tracker_string_to_uint (const gchar *s,
+ guint *ret);
+gint tracker_string_in_string_list (const gchar *str,
+ gchar **strv);
+GSList * tracker_string_list_to_gslist (gchar **strv,
+ gsize length);
+gchar * tracker_string_list_to_string (gchar **strv,
+ gsize length,
+ gchar sep);
+gchar ** tracker_string_to_string_list (const gchar *str);
+gchar ** tracker_gslist_to_string_list (GSList *list);
+GSList * tracker_gslist_copy_with_string_data (GSList *list);
/* "true" -> "1"; "false" -> "0" */
-gchar * tracker_boolean_as_text_to_number (const gchar *value);
+gchar * tracker_boolean_as_text_to_number (const gchar *value);
+
+G_END_DECLS
#endif /* __LIBTRACKER_COMMON_TYPE_UTILS_H__ */
Modified: branches/indexer-split/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-manager.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-manager.c Tue Aug 19 12:00:35 2008
@@ -256,7 +256,7 @@
g_error ("Duplicated metadata description %s", groups[i]);
}
- str_id = tracker_uint_to_string (id);
+ str_id = tracker_guint_to_string (id);
keys = g_key_file_get_keys (key_file, groups[i], NULL, NULL);
for (j = 0; keys[j]; j++) {
@@ -349,7 +349,7 @@
id = tracker_service_get_id (service);
}
- str_id = tracker_uint_to_string (id);
+ str_id = tracker_guint_to_string (id);
keys = g_key_file_get_keys (key_file, groups[i], NULL, NULL);
@@ -675,7 +675,7 @@
}
/* Get inserted ID */
- str_id = tracker_uint_to_string (id);
+ str_id = tracker_guint_to_string (id);
keys = g_key_file_get_keys (key_file, groups[i], NULL, NULL);
for (j = 0; keys[j]; j++) {
@@ -949,7 +949,7 @@
9, &store_metadata,
-1);
- id_str = tracker_int_to_string (id);
+ id_str = tracker_gint_to_string (id);
tracker_field_set_id (field_def, id_str);
tracker_field_set_name (field_def, name);
@@ -1574,7 +1574,7 @@
while (valid) {
tracker_db_result_set_get (result_set2, 1, &id, -1);
child_ids = g_slist_prepend (child_ids,
- tracker_int_to_string (id));
+ tracker_gint_to_string (id));
valid = tracker_db_result_set_iter_next (result_set2);
}
Modified: branches/indexer-split/src/tracker-indexer/modules/evolution.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/evolution.c (original)
+++ branches/indexer-split/src/tracker-indexer/modules/evolution.c Tue Aug 19 12:00:35 2008
@@ -773,7 +773,7 @@
g_mime_message_get_date (message, &date, NULL);
tracker_metadata_insert (metadata, METADATA_EMAIL_DATE,
- tracker_uint_to_string (date));
+ tracker_guint_to_string (date));
tracker_metadata_insert (metadata, METADATA_EMAIL_SENDER,
g_strdup (g_mime_message_get_sender (message)));
@@ -1172,7 +1172,7 @@
tracker_metadata_insert (metadata, METADATA_FILE_NAME, basename);
tracker_metadata_insert (metadata, METADATA_EMAIL_DATE,
- tracker_uint_to_string (date));
+ tracker_guint_to_string (date));
tracker_metadata_insert (metadata, METADATA_EMAIL_SENDER, from);
tracker_metadata_insert (metadata, METADATA_EMAIL_SUBJECT, subject);
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c Tue Aug 19 12:00:35 2008
@@ -215,7 +215,7 @@
TRACKER_DB_CONTENT_TYPE_METADATA);
id_str = tracker_guint32_to_string (id);
- service_type_id_str = tracker_int_to_string (tracker_service_get_id (service));
+ service_type_id_str = tracker_gint_to_string (tracker_service_get_id (service));
path = g_build_filename (dirname, basename, NULL);
Modified: branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c Tue Aug 19 12:00:35 2008
@@ -289,11 +289,11 @@
/* FIXME: These should be dealt directly as integer/times/whatever, not strings */
tracker_metadata_insert (metadata, METADATA_FILE_SIZE,
- tracker_uint_to_string (st.st_size));
+ tracker_guint_to_string (st.st_size));
tracker_metadata_insert (metadata, METADATA_FILE_MODIFIED,
- tracker_uint_to_string (st.st_mtime));
+ tracker_guint_to_string (st.st_mtime));
tracker_metadata_insert (metadata, METADATA_FILE_ACCESSED,
- tracker_uint_to_string (st.st_atime));
+ tracker_guint_to_string (st.st_atime));
tracker_metadata_utils_get_embedded (path, mimetype, metadata);
Modified: branches/indexer-split/src/trackerd/tracker-crawler.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-crawler.c (original)
+++ branches/indexer-split/src/trackerd/tracker-crawler.c Tue Aug 19 12:00:35 2008
@@ -26,6 +26,7 @@
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-module-config.h>
@@ -78,6 +79,11 @@
GList *ignored_file_patterns;
GList *index_file_patterns;
+ /* Legacy NoWatchDirectoryRoots */
+ GSList *no_watch_directory_roots;
+ GSList *watch_directory_roots;
+ GSList *crawl_directory_roots;
+
/* Statistics */
GTimer *timer;
guint enumerations;
@@ -186,6 +192,15 @@
g_timer_destroy (priv->timer);
}
+ g_slist_foreach (priv->no_watch_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->no_watch_directory_roots);
+
+ g_slist_foreach (priv->watch_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->watch_directory_roots);
+
+ g_slist_foreach (priv->crawl_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->crawl_directory_roots);
+
if (priv->index_file_patterns) {
g_list_free (priv->index_file_patterns);
}
@@ -194,10 +209,6 @@
g_list_free (priv->ignored_file_patterns);
}
- if (priv->ignored_directory_patterns) {
- g_list_free (priv->ignored_directory_patterns);
- }
-
/* Don't free the 'current_' variant of these, they are just
* place holders so we know our status.
*/
@@ -269,7 +280,6 @@
gchar *basename;
gboolean ignore;
-
if (tracker_is_empty_string (path)) {
return TRUE;
}
@@ -279,42 +289,82 @@
return TRUE;
}
- /* Most common things to ignore */
- if (strcmp (path, "/boot") == 0 ||
- strcmp (path, "/dev") == 0 ||
- strcmp (path, "/lib") == 0 ||
- strcmp (path, "/proc") == 0 ||
- strcmp (path, "/sys") == 0 ||
- strcmp (path, "/tmp") == 0 ||
- strcmp (path, "/var") == 0) {
- return TRUE;
- }
+ if (is_directory) {
+ GSList *sl;
- if (g_str_has_prefix (path, g_get_tmp_dir ())) {
- return TRUE;
+ /* Most common things to ignore */
+ if (strcmp (path, "/dev") == 0 ||
+ strcmp (path, "/lib") == 0 ||
+ strcmp (path, "/proc") == 0 ||
+ strcmp (path, "/sys") == 0) {
+ return TRUE;
+ }
+
+ if (g_str_has_prefix (path, g_get_tmp_dir ())) {
+ return TRUE;
+ }
+
+ /* Check ignored directories in config */
+ for (sl = crawler->private->no_watch_directory_roots; sl; sl = sl->next) {
+ if (strcmp (sl->data, path) == 0) {
+ return TRUE;
+ }
+ }
}
+ /* Check basename against pattern matches */
basename = g_path_get_basename (path);
ignore = TRUE;
- if (!basename || basename[0] == '.') {
+ if (!basename) {
goto done;
}
/* Test ignore types */
if (is_directory) {
+ GSList *sl;
+
+ /* If directory begins with ".", check it isn't one of
+ * the top level directories to watch/crawl if it
+ * isn't we ignore it. If it is, we don't.
+ */
+ if (basename[0] == '.') {
+ for (sl = crawler->private->watch_directory_roots; sl; sl = sl->next) {
+ if (strcmp (sl->data, path) == 0) {
+ ignore = FALSE;
+ goto done;
+ }
+ }
+
+ for (sl = crawler->private->crawl_directory_roots; sl; sl = sl->next) {
+ if (strcmp (sl->data, path) == 0) {
+ ignore = FALSE;
+ goto done;
+ }
+ }
+
+ goto done;
+ }
+
+ /* Check module directory ignore patterns */
for (l = crawler->private->ignored_directory_patterns; l; l = l->next) {
if (g_pattern_match_string (l->data, basename)) {
goto done;
}
}
} else {
+ if (basename[0] == '.') {
+ goto done;
+ }
+
+ /* Check module file ignore patterns */
for (l = crawler->private->ignored_file_patterns; l; l = l->next) {
if (g_pattern_match_string (l->data, basename)) {
goto done;
}
}
+ /* Check module file match patterns */
for (l = crawler->private->index_file_patterns; l; l = l->next) {
if (!g_pattern_match_string (l->data, basename)) {
goto done;
@@ -422,9 +472,12 @@
return TRUE;
}
- /* Make sure we throttle the processing */
- tracker_throttle (priv->config, 100);
-
+ /* Throttle the crawler, with testing, throttling every item
+ * took the time to crawl 130k files from 7 seconds up to 68
+ * seconds. So it is important to get this figure right.
+ */
+ tracker_throttle (priv->config, 25);
+
/* Crawler files */
file = g_queue_pop_head (priv->files);
@@ -804,6 +857,7 @@
return FALSE;
}
+ /* Filter duplicates */
sl = priv->paths;
priv->paths = tracker_path_list_filter_duplicates (priv->paths);
@@ -816,6 +870,24 @@
g_slist_foreach (sl, (GFunc) g_free, NULL);
g_slist_free (sl);
+ /* Set up legacy NoWatchDirectoryRoots so we don't have to get
+ * them from the config for EVERY file we traverse.
+ */
+ g_slist_foreach (priv->no_watch_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->no_watch_directory_roots);
+ sl = tracker_config_get_no_watch_directory_roots (priv->config);
+ priv->no_watch_directory_roots = tracker_gslist_copy_with_string_data (sl);
+
+ g_slist_foreach (priv->watch_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->watch_directory_roots);
+ sl = tracker_config_get_watch_directory_roots (priv->config);
+ priv->watch_directory_roots = tracker_gslist_copy_with_string_data (sl);
+
+ g_slist_foreach (priv->crawl_directory_roots, (GFunc) g_free, NULL);
+ g_slist_free (priv->crawl_directory_roots);
+ sl = tracker_config_get_crawl_directory_roots (priv->config);
+ priv->crawl_directory_roots = tracker_gslist_copy_with_string_data (sl);
+
/* Time the event */
if (priv->timer) {
g_timer_destroy (priv->timer);
Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db.c Tue Aug 19 12:00:35 2008
@@ -279,7 +279,7 @@
g_free (dvalue);
if (time != -1) {
- return tracker_int_to_string (time);
+ return tracker_gint_to_string (time);
}
}
@@ -311,7 +311,7 @@
id,
NULL);
id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (iface));
- backup_id = tracker_int_to_string (id);
+ backup_id = tracker_gint_to_string (id);
}
return backup_id;
@@ -438,7 +438,7 @@
g_free (eid);
i++;
- eid = tracker_int_to_string (i);
+ eid = tracker_gint_to_string (i);
result_set = tracker_db_exec_proc (iface,
"UpdateNewEventID",
@@ -702,7 +702,7 @@
}
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
- str_id = tracker_uint_to_string (rank.service_id);
+ str_id = tracker_guint_to_string (rank.service_id);
/* We save results into SearchResults table instead of
* returing an array of array of strings
@@ -710,7 +710,7 @@
if (save_results) {
gchar *str_score;
- str_score = tracker_int_to_string (rank.score);
+ str_score = tracker_gint_to_string (rank.score);
tracker_db_exec_proc (iface,
"InsertSearchResult1",
str_id,
@@ -851,7 +851,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
- str_id = tracker_uint_to_string (rank.service_id);
+ str_id = tracker_guint_to_string (rank.service_id);
result_set2 = tracker_db_exec_proc (iface,
"GetFileByID",
str_id,
@@ -947,7 +947,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
- str_id = tracker_uint_to_string (rank.service_id);
+ str_id = tracker_guint_to_string (rank.service_id);
result_set2 = tracker_db_exec_proc (iface,
"GetFileByID",
str_id,
@@ -1045,7 +1045,7 @@
rank = g_array_index (hits, TrackerDBIndexItemRank, i);
- str_id = tracker_uint_to_string (rank.service_id);
+ str_id = tracker_guint_to_string (rank.service_id);
result_set2 = tracker_db_exec_proc (iface,
"GetFileByID",
str_id,
@@ -2447,7 +2447,7 @@
g_free (sid);
i++;
- sid = tracker_int_to_string (i);
+ sid = tracker_gint_to_string (i);
result_set_proc = tracker_db_exec_proc (iface, "UpdateNewID", sid, NULL);
if (result_set_proc) {
@@ -2484,8 +2484,8 @@
service, service_type_id, sid);
}
- str_service_type_id = tracker_int_to_string (service_type_id);
- str_aux = tracker_int_to_string (info->aux_id);
+ str_service_type_id = tracker_gint_to_string (service_type_id);
+ str_aux = tracker_gint_to_string (info->aux_id);
if (service_type_id != -1) {
gchar *parent;
@@ -2646,7 +2646,7 @@
id = tracker_db_file_get_id (iface, uri);
if (id > 0) {
- return tracker_uint_to_string (id);
+ return tracker_guint_to_string (id);
}
return NULL;
@@ -2706,8 +2706,8 @@
g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
g_return_val_if_fail (service != NULL, NULL);
- str_limit = tracker_int_to_string (limit);
- str_offset = tracker_int_to_string (offset);
+ str_limit = tracker_gint_to_string (limit);
+ str_offset = tracker_gint_to_string (offset);
result_set = tracker_db_exec_proc (iface,
"GetByServiceType",
@@ -2948,7 +2948,7 @@
iface = tracker_db_manager_get_db_interface_by_service (TRACKER_DB_FOR_FILE_SERVICE);
- str = tracker_int_to_string (value);
+ str = tracker_gint_to_string (value);
result_set = tracker_db_exec_proc (iface, "SetOption", str, option, NULL);
g_free (str);
Modified: branches/indexer-split/src/trackerd/tracker-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-files.c (original)
+++ branches/indexer-split/src/trackerd/tracker-files.c Tue Aug 19 12:00:35 2008
@@ -267,7 +267,7 @@
}
/* Get mime */
- file_id_str = tracker_uint_to_string (file_id);
+ file_id_str = tracker_guint_to_string (file_id);
mime = NULL;
result_set = tracker_db_metadata_get (iface,
@@ -369,8 +369,8 @@
}
}
- offset_str = tracker_int_to_string (offset);
- max_length_str = tracker_int_to_string (max_length);
+ offset_str = tracker_gint_to_string (offset);
+ max_length_str = tracker_gint_to_string (max_length);
result_set = tracker_db_exec_proc (iface,
"GetFileContents",
@@ -447,7 +447,7 @@
path = tracker_file_get_vfs_path (uri);
}
- max_length_str = tracker_int_to_string (max_length);
+ max_length_str = tracker_gint_to_string (max_length);
/* result_set = tracker_exec_proc (iface, */
/* "SearchFileContents", */
Modified: branches/indexer-split/src/trackerd/tracker-metadata.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-metadata.c (original)
+++ branches/indexer-split/src/trackerd/tracker-metadata.c Tue Aug 19 12:00:35 2008
@@ -578,8 +578,8 @@
g_free (rdf_from);
g_free (rdf_where);
- str_offset = tracker_int_to_string (offset);
- str_limit = tracker_int_to_string (metadata_sanity_check_max_hits (max_hits));
+ str_offset = tracker_gint_to_string (offset);
+ str_limit = tracker_gint_to_string (metadata_sanity_check_max_hits (max_hits));
g_string_append_printf (sql_order, " LIMIT %s,%s", str_offset, str_limit);
Modified: branches/indexer-split/src/trackerd/tracker-processor.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-processor.c (original)
+++ branches/indexer-split/src/trackerd/tracker-processor.c Tue Aug 19 12:00:35 2008
@@ -664,6 +664,25 @@
processor);
}
+static gboolean
+is_path_on_ignore_list (GSList *ignore_list,
+ const gchar *path)
+{
+ GSList *l;
+
+ if (!ignore_list || !path) {
+ return FALSE;
+ }
+
+ for (l = ignore_list; l; l = l->next) {
+ if (strcmp (path, l->data) == 0) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
static void
process_module_files_add_removable_media (TrackerProcessor *processor)
{
@@ -726,30 +745,53 @@
process_module_files_add_legacy_options (TrackerProcessor *processor)
{
TrackerCrawler *crawler;
+ GSList *no_watch_roots;
GSList *watch_roots;
GSList *crawl_roots;
GSList *l;
+ guint watch_root_count;
+ guint crawl_root_count;
const gchar *module_name = "files";
crawler = g_hash_table_lookup (processor->private->crawlers, module_name);
+ no_watch_roots = tracker_config_get_no_watch_directory_roots (processor->private->config);
watch_roots = tracker_config_get_watch_directory_roots (processor->private->config);
crawl_roots = tracker_config_get_crawl_directory_roots (processor->private->config);
+ watch_root_count = 0;
+ crawl_root_count = 0;
+
/* This module get special treatment to make sure legacy
* options are supported.
*/
+ /* Print ignored locations */
+ g_message (" User ignored crawls & monitors:");
+ for (l = no_watch_roots; l; l = l->next) {
+ g_message (" %s", (gchar*) l->data);
+ }
+
+ if (g_slist_length (no_watch_roots) == 0) {
+ g_message (" NONE");
+ }
+
/* Add monitors, from WatchDirectoryRoots config key */
g_message (" User monitors being added:");
for (l = watch_roots; l; l = l->next) {
GFile *file;
+ if (is_path_on_ignore_list (no_watch_roots, l->data)) {
+ continue;
+ }
+
g_message (" %s", (gchar*) l->data);
file = g_file_new_for_path (l->data);
tracker_monitor_add (processor->private->monitor, module_name, file);
g_object_unref (file);
+
+ watch_root_count++;
}
if (g_slist_length (watch_roots) == 0) {
@@ -762,15 +804,23 @@
g_message (" User crawls being added:");
for (l = watch_roots; l; l = l->next) {
+ if (is_path_on_ignore_list (no_watch_roots, l->data)) {
+ continue;
+ }
+
g_message (" %s", (gchar*) l->data);
-
tracker_crawler_add_path (crawler, l->data);
}
for (l = crawl_roots; l; l = l->next) {
+ if (is_path_on_ignore_list (no_watch_roots, l->data)) {
+ continue;
+ }
+
g_message (" %s", (gchar*) l->data);
-
- tracker_crawler_add_path (crawler, l->data);
+ tracker_crawler_add_path (crawler, l->data);
+
+ crawl_root_count++;
}
if (g_slist_length (watch_roots) == 0 &&
Modified: branches/indexer-split/src/trackerd/tracker-rdf-query.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-rdf-query.c (original)
+++ branches/indexer-split/src/trackerd/tracker-rdf-query.c Tue Aug 19 12:00:35 2008
@@ -771,7 +771,7 @@
bvalue = tracker_date_format (avalue);
cvalue = tracker_string_to_date (bvalue);
- value = tracker_int_to_string (cvalue);
+ value = tracker_gint_to_string (cvalue);
g_free (bvalue);
} else {
value = g_strdup (avalue);
Modified: branches/indexer-split/src/trackerd/tracker-xesam-query.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-xesam-query.c (original)
+++ branches/indexer-split/src/trackerd/tracker-xesam-query.c Tue Aug 19 12:00:35 2008
@@ -1004,7 +1004,7 @@
g_debug (bvalue);
cvalue = tracker_string_to_date (bvalue);
g_debug ("%d", cvalue);
- value = tracker_int_to_string (cvalue);
+ value = tracker_gint_to_string (cvalue);
g_free (bvalue);
} else if (state == STATE_END_BOOLEAN) {
/* FIXME We do a state check here, because
Modified: branches/indexer-split/tests/libtracker-common/tracker-type-utils-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-common/tracker-type-utils-test.c (original)
+++ branches/indexer-split/tests/libtracker-common/tracker-type-utils-test.c Tue Aug 19 12:00:35 2008
@@ -137,12 +137,12 @@
gchar *result;
n = 10050;
- result = tracker_long_to_string (n);
+ result = tracker_glong_to_string (n);
g_assert (tracker_test_helpers_cmpstr_equal (result, "10050"));
g_free (result);
n = -9950;
- result = tracker_long_to_string (n);
+ result = tracker_glong_to_string (n);
g_assert (tracker_test_helpers_cmpstr_equal (result, "-9950"));
g_free (result);
}
@@ -154,12 +154,12 @@
gchar *result;
n = 654;
- result = tracker_int_to_string (n);
+ result = tracker_gint_to_string (n);
g_assert (tracker_test_helpers_cmpstr_equal (result, "654"));
g_free (result);
n = -963;
- result = tracker_int_to_string (n);
+ result = tracker_gint_to_string (n);
g_assert (tracker_test_helpers_cmpstr_equal (result, "-963"));
g_free (result);
@@ -173,7 +173,7 @@
gchar *result;
n = 100;
- result = tracker_uint_to_string (n);
+ result = tracker_guint_to_string (n);
g_assert (tracker_test_helpers_cmpstr_equal (result, "100"));
g_free (result);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]