diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-17 16:26:43 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-17 16:44:06 +0800 |
commit | 8750c21d6838bd83065f735470fb96de867ed31f (patch) | |
tree | 3ff8457567480e3fc6dbca285c3559b19acec2c4 /tools/manager-file.py | |
parent | f9a38137925ff6f712afe21961614a1efb3b35ea (diff) | |
download | gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.gz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.bz2 gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.lz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.xz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.zst gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.zip |
sync tools/* with tp-glib master
Fix extensions/Makefile.am to build with the new tools.
Diffstat (limited to 'tools/manager-file.py')
-rw-r--r-- | tools/manager-file.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/manager-file.py b/tools/manager-file.py index 45f640403..e1b51a616 100644 --- a/tools/manager-file.py +++ b/tools/manager-file.py @@ -163,13 +163,25 @@ if __name__ == '__main__': environment = {} execfile(sys.argv[1], environment) - f = open('%s/%s.manager' % (sys.argv[2], environment['MANAGER']), 'w') + filename = '%s/%s.manager' % (sys.argv[2], environment['MANAGER']) + try: + os.remove(filename) + except OSError: + pass + f = open(filename + '.tmp', 'w') write_manager(f, environment['MANAGER'], environment['PARAMS']) f.close() - - f = open('%s/param-spec-struct.h' % sys.argv[2], 'w') + os.rename(filename + '.tmp', filename) + + filename = '%s/param-spec-struct.h' % sys.argv[2] + try: + os.remove(filename) + except OSError: + pass + f = open(filename + '.tmp', 'w') for protocol in environment['PARAMS']: write_c_params(f, environment['MANAGER'], protocol, environment['STRUCTS'][protocol], environment['PARAMS'][protocol]) f.close() + os.rename(filename + '.tmp', filename) |