[jhbuild] Revert excessive simplifcation of gconf support



commit ed323685c1fee3b0c2d0948d3cf3a2bfa80651eb
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Jul 4 18:45:13 2009 +0100

    Revert excessive simplifcation of gconf support
    
    Commit 7e4e50c6387517769001241fd57e3e5f9aecc296 accidentally
    changed the behavior and instead of creating a merged GConf
    path file, created a GConf path file that only looked in the
    JHBuild directory.
    
    Also cleanups:
    
     - Maintain nominal compat with Python-2.2
     - Use 'needle in haystack' rather than 'haystack.find(needle) != -1'
    
    http://bugzilla.gnome.org/show_bug.cgi?id=587764

 jhbuild/config.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/config.py b/jhbuild/config.py
index cf4b16d..599d25a 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -425,8 +425,14 @@ class Config:
         gconfpath = os.path.join(gconfpathdir, 'path.jhbuild')
         if not os.path.exists(gconfpath) and os.path.exists('/etc/gconf/2/path'):
             try:
-                file(gconfpath, 'w').write(
-                        file('/etc/gconf/2/path').read().replace('/etc/gconf', gconfdir))
+                inp = open('/etc/gconf/2/path')
+                out = open(gconfpath, 'w')
+                for line in inp.readlines():
+                    if '/etc/gconf' in line:
+                        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)



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