[tracker] Make TrackerDBInterfaceSqlite listen to the TRACKER_DB_MODULES_DIR ennvar.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Make TrackerDBInterfaceSqlite listen to the TRACKER_DB_MODULES_DIR ennvar.
- Date: Wed, 29 Jul 2009 16:00:47 +0000 (UTC)
commit 48078bb9229c37e3d1bcfa620a9bcf87babc3768
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Jul 29 17:59:42 2009 +0200
Make TrackerDBInterfaceSqlite listen to the TRACKER_DB_MODULES_DIR ennvar.
This is used to load the tracker-fts.so module from non-common paths.
src/libtracker-db/tracker-db-interface-sqlite.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index b2c658a..9f8bbd2 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -22,6 +22,7 @@
#include <glib/gstdio.h>
#include <sqlite3.h>
+#include <stdlib.h>
#include "tracker-db-interface-sqlite.h"
@@ -102,6 +103,7 @@ tracker_db_interface_sqlite_constructor (GType type,
GObject *object;
TrackerDBInterfaceSqlitePrivate *priv;
gchar *err_msg = NULL;
+ gchar *env_path;
object = (* G_OBJECT_CLASS (tracker_db_interface_sqlite_parent_class)->constructor) (type,
n_construct_properties,
@@ -127,7 +129,18 @@ tracker_db_interface_sqlite_constructor (GType type,
sqlite3_busy_timeout (priv->db, 100000);
sqlite3_enable_load_extension (priv->db, 1);
- sqlite3_load_extension (priv->db, PKGLIBDIR "/tracker-fts.so", NULL, &err_msg);
+
+ env_path = getenv ("TRACKER_DB_MODULES_DIR");
+
+ if (G_LIKELY (!env_path)) {
+ sqlite3_load_extension (priv->db, PKGLIBDIR "/tracker-fts.so", NULL, &err_msg);
+ } else {
+ gchar *filename;
+
+ filename = g_build_filename (env_path, "tracker-fts.so", NULL);
+ sqlite3_load_extension (priv->db, PKGLIBDIR "/tracker-fts.so", NULL, &err_msg);
+ g_free (filename);
+ }
if (err_msg) {
g_critical ("Could not load tracker-fts extension:'%s'", err_msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]