[tracker/tracker-0.10: 31/32] libtracker-common: Remove tracker_env_check_xdg_dirs
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10: 31/32] libtracker-common: Remove tracker_env_check_xdg_dirs
- Date: Thu, 30 Jun 2011 08:53:36 +0000 (UTC)
commit 2704965954d1a3b66fa7d13c514817b524652e14
Author: JÃrg Billeter <j bitron ch>
Date: Tue Jun 28 11:12:16 2011 +0200
libtracker-common: Remove tracker_env_check_xdg_dirs
This was used as a workaround on broken platforms where XDG_DATA_HOME
was not writable.
src/libtracker-common/libtracker-common.vapi | 2 -
src/libtracker-common/tracker-file-utils.c | 46 --------------------------
src/libtracker-common/tracker-file-utils.h | 3 --
src/miners/fs/tracker-main.c | 5 ---
src/tracker-store/tracker-main.vala | 5 ---
5 files changed, 0 insertions(+), 61 deletions(-)
---
diff --git a/src/libtracker-common/libtracker-common.vapi b/src/libtracker-common/libtracker-common.vapi
index f7a8bab..b9b9c43 100644
--- a/src/libtracker-common/libtracker-common.vapi
+++ b/src/libtracker-common/libtracker-common.vapi
@@ -76,8 +76,6 @@ namespace Tracker {
}
[CCode (cheader_filename = "libtracker-common/tracker-common.h")]
- public bool env_check_xdg_dirs ();
- [CCode (cheader_filename = "libtracker-common/tracker-common.h")]
public void ioprio_init ();
[CCode (cname = "g_message", cheader_filename = "glib.h")]
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index 4a2aa80..5a939cc 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -647,52 +647,6 @@ tracker_path_has_write_access_or_was_created (const gchar *path)
}
gboolean
-tracker_env_check_xdg_dirs (void)
-{
- const gchar *user_data_dir;
- gchar *new_dir;
- gboolean success;
-
- g_message ("Checking XDG_DATA_HOME is writable and exists");
-
- /* NOTE: We don't use g_get_user_data_dir() here because as
- * soon as we do, it sets the result and doesn't re-fetch the
- * XDG_DATA_HOME environment variable which we set below.
- */
- user_data_dir = g_getenv ("XDG_DATA_HOME");
-
- /* Check the default XDG_DATA_HOME location */
- g_message (" XDG_DATA_HOME is '%s'", user_data_dir);
-
- if (user_data_dir && tracker_path_has_write_access_or_was_created (user_data_dir)) {
- return TRUE;
- }
-
- user_data_dir = g_getenv ("HOME");
-
- if (!user_data_dir || !tracker_path_has_write_access_or_was_created (user_data_dir)) {
- user_data_dir = g_get_home_dir ();
- }
-
- /* Change environment, this is actually what we have on Ubuntu. */
- new_dir = g_build_path (G_DIR_SEPARATOR_S, user_data_dir, ".local", "share", NULL);
-
- /* Check the new XDG_DATA_HOME location */
- success = g_setenv ("XDG_DATA_HOME", new_dir, TRUE);
-
- if (success) {
- g_message (" XDG_DATA_HOME set to '%s'", new_dir);
- success = tracker_path_has_write_access_or_was_created (new_dir);
- } else {
- g_message (" XDG_DATA_HOME could not be set");
- }
-
- g_free (new_dir);
-
- return success;
-}
-
-gboolean
tracker_file_lock (GFile *file)
{
gint fd, retval;
diff --git a/src/libtracker-common/tracker-file-utils.h b/src/libtracker-common/tracker-file-utils.h
index 48949b9..6c5be1e 100644
--- a/src/libtracker-common/tracker-file-utils.h
+++ b/src/libtracker-common/tracker-file-utils.h
@@ -65,9 +65,6 @@ gboolean tracker_file_system_has_enough_space (const gchar *path,
guint64 tracker_file_system_get_remaining_space (const gchar *path);
gdouble tracker_file_system_get_remaining_space_percentage (const gchar *path);
-/* Environment path utils */
-gboolean tracker_env_check_xdg_dirs (void);
-
G_END_DECLS
#endif /* __LIBTRACKER_COMMON_FILE_UTILS_H__ */
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index cd2f2f4..b20d329 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -734,11 +734,6 @@ main (gint argc, gchar *argv[])
sanity_check_option_values (config);
- /* Check XDG spec locations XDG_DATA_HOME _MUST_ be writable. */
- if (!tracker_env_check_xdg_dirs ()) {
- return EXIT_FAILURE;
- }
-
main_loop = g_main_loop_new (NULL, FALSE);
g_message ("Checking if we're running as a daemon:");
diff --git a/src/tracker-store/tracker-main.vala b/src/tracker-store/tracker-main.vala
index 19f299e..b0ccdd6 100644
--- a/src/tracker-store/tracker-main.vala
+++ b/src/tracker-store/tracker-main.vala
@@ -205,11 +205,6 @@ License which can be viewed at:
sanity_check_option_values (config);
- /* Check XDG spec locations XDG_DATA_HOME _MUST_ be writable. */
- if (!Tracker.env_check_xdg_dirs ()) {
- return 1;
- }
-
if (!Tracker.DBus.init ()) {
return 1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]