[gconf] Allow the backend directory to be specified from the environment.



commit 635d28cbf635d89b8bbbb008bf86cc864b8dabb7
Author: Richard Purdie <richard purdie intel com>
Date:   Mon Nov 28 14:34:43 2011 +0000

    Allow the backend directory to be specified from the environment.
    
    This is required in Yoctor so we can relocate gconf-native to different paths
    and still allow it to work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664650

 gconf/gconf-backend.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gconf/gconf-backend.c b/gconf/gconf-backend.c
index c11bb87..044c0f1 100644
--- a/gconf/gconf-backend.c
+++ b/gconf/gconf-backend.c
@@ -21,6 +21,7 @@
 #include <config.h>
 #include "gconf-backend.h"
 #include "gconf-internals.h"
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/stat.h>
@@ -171,6 +172,7 @@ gconf_backend_file(const gchar* address)
   gchar* back;
   gchar* file;
   gchar* retval;
+  const gchar* backenddir;
 
   g_return_val_if_fail(address != NULL, NULL);
 
@@ -179,9 +181,13 @@ gconf_backend_file(const gchar* address)
   if (back == NULL)
     return NULL;
 
+  backenddir = g_getenv("GCONF_BACKEND_DIR");
+  if (backenddir == NULL)
+    backenddir = GCONF_BACKEND_DIR;
+
   file = g_strconcat("gconfbackend-", back, NULL);
   
-  retval = g_module_build_path(GCONF_BACKEND_DIR, file);
+  retval = g_module_build_path(backenddir, file);
 
   g_free(back);
 



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