[jhbuild] Add support for using GConf schemas installed in the jhbuild prefix



commit 66125d9106294132e1d0c949ec3aecb89549b2c7
Author: Dan Winship <danw gnome org>
Date:   Thu Jun 18 14:55:14 2009 -0400

    Add support for using GConf schemas installed in the jhbuild prefix
    
    Set GCONF_SCHEMA_INSTALL_SOURCE to point into the jhbuild prefix so
    modules will install their schemas there (rather than failing to
    install them into /etc).
    
    Create a GConf source path file that tells GConf to use the data in
    the jhbuild prefix (in addition to the data in the system prefix), and
    point to it with GCONF_DEFAULT_SOURCE_PATH so modules will be read the
    right data (assuming a new enough libgconf).
    
    http://bugzilla.gnome.org/show_bug.cgi?id=586185

 jhbuild/config.py |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 2c1f3cc..1aaf623 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -413,6 +413,29 @@ class Config:
         os.environ['MONO_PREFIX'] = self.prefix
         os.environ['MONO_GAC_PREFIX'] = self.prefix
 
+        # GConf
+        gconfdir = os.path.join(self.prefix, 'etc', 'gconf')
+        gconfpathdir = os.path.join(gconfdir, '2')
+        if not os.path.exists(gconfpathdir):
+            os.makedirs(gconfpathdir)
+        gconfpath = os.path.join(gconfpathdir, 'path.jhbuild')
+        if not os.path.exists(gconfpath):
+            try:
+                inp = open('/etc/gconf/2/path')
+                out = open(gconfpath, 'w')
+                for line in inp:
+                    if line.find('/etc/gconf') != -1:
+                        out.write(line.replace('/etc/gconf', gconfdir))
+                    out.write(line)
+                out.close()
+                inp.close()
+            except:
+                traceback.print_exc()
+                raise FatalError(_('Could not create GConf config (%s)') % gconfpath)
+
+        os.environ['GCONF_DEFAULT_SOURCE_PATH'] = gconfpath
+        os.environ['GCONF_SCHEMA_INSTALL_SOURCE'] = 'xml:merged:' + os.path.join(gconfdir, 'gconf.xml.defaults')
+
         # handle environment prepends ...
         for envvar in env_prepends.keys():
             for path in env_prepends[envvar]:



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