diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-25 05:27:33 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-25 05:27:33 (GMT) |
commit | ddc6c45e773b439a2778f71de9a70f912d836e33 (patch) | |
tree | aee70731b7406364215bdad15a648986c8da118e /sugar-jhbuild |
Initial import
Diffstat (limited to 'sugar-jhbuild')
-rwxr-xr-x | sugar-jhbuild | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sugar-jhbuild b/sugar-jhbuild new file mode 100755 index 0000000..905a4e2 --- /dev/null +++ b/sugar-jhbuild @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +import os +import sys + +def update_jhbuild(): + print 'Updating jhbuild...' + sys.path.append(os.path.join(base_dir)) + import cvs + + os.chdir(build_scripts_dir) + + cvsroot = ':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome' + cvs.login(cvsroot, 'anonymous') + cvs.checkout(cvsroot, 'jhbuild') + + os.chdir(exec_dir) + +def configure(): + config_file = os.path.join(build_scripts_dir, 'olpc.jhbuildrc') + return jhbuild.config.Config(config_file) + +exec_dir = os.getcwd() +base_dir = os.path.abspath(os.path.dirname(__file__)) +build_scripts_dir = os.path.join(base_dir, 'build-scripts') + +if len(sys.argv) > 1: + command = sys.argv[1] + args = sys.argv[2:] +else: + command = 'build' + args = sys.argv[1:] + +if command == 'build': + update_jhbuild() + +sys.path.append(os.path.join(build_scripts_dir, 'jhbuild')) +import jhbuild.config +import jhbuild.commands + +config = configure() + +jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share') + +path = 'lib/python2.4/site-packages' +jhbuild.config.addpath('PYTHONPATH', os.path.join(config.prefix, path)) + +path = 'lib/gtk-2.0/' +jhbuild.config.addpath('GTK_PATH', os.path.join(config.prefix, path)) + +path = 'share/themes/olpc/gtk-2.0/gtkrc' +jhbuild.config.addpath('GTK2_RC_FILES', os.path.join(config.prefix, path)) + +if command == 'run' and len(args) == 0: + jhbuild.commands.run(command, config, ['sugar']) +else: + jhbuild.commands.run(command, config, args) |