From 9f2bbbbebfa7b6f2de89520c6f591549d1ae2667 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 20 Apr 2008 00:36:11 +0000 Subject: Pull jhbuild instead of using an internal copy. Directory structure cleanups. --- (limited to 'sugar-jhbuild') diff --git a/sugar-jhbuild b/sugar-jhbuild index 0f1154c..445ee8f 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -5,14 +5,33 @@ import sys import subprocess base_dir = os.path.abspath(os.path.dirname(__file__)) -sys.path.append(os.path.join(base_dir, 'build-scripts', 'jhbuild')) +jhbuild_dir = os.path.join(base_dir, 'jhbuild') -# The update needs to be very early, before we load any module -if len(sys.argv) == 1 or (len(sys.argv) > 1 and sys.argv[1] == 'build'): - print 'Updating sugar-jhbuild...' - retcode = subprocess.call(['git', 'pull']) +sys.path.append(os.path.join(base_dir, 'scripts')) +sys.path.append(jhbuild_dir) + +if os.path.exists(jhbuild_dir): + if len(sys.argv) == 1 or (len(sys.argv) > 1 and sys.argv[1] == 'build'): + print 'Updating sugar-jhbuild...' + + cwd = os.getcwd() + os.chdir(jhbuild_dir) + + retcode = subprocess.call(['git', 'pull']) + if retcode: + print 'Failed to update sugar-jhbuild.' + + os.chdir(cwd) +else: + cwd = os.getcwd() + os.chdir(base_dir) + + jhbuild_repo = 'git://dev.laptop.org/users/marco/jhbuild' + retcode = subprocess.call(['git', 'clone', jhbuild_repo]) if retcode: - print 'sugar-jhbuild update failed.' + print 'Failed to clone sugar-jhbuild.' + + os.chdir(cwd) import main -- cgit v0.9.1