From 95e2c115896e0b2bf1a763b0cc962b556c53ef8b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 10 Apr 2008 13:42:41 +0000 Subject: Fetch jhbuild as a submodule. --- (limited to 'sugar-jhbuild') diff --git a/sugar-jhbuild b/sugar-jhbuild index 5cd450c..5f964fa 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -5,13 +5,19 @@ 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, 'build-scripts', 'jhbuild') +sys.path.append(jhbuild_dir) # 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']) - if retcode: + + try: + subprocess.check_call(['git', 'pull']) + if not os.path.exists(os.path.join(jhbuild_dir, '.git')): + subprocess.check_call(['git', 'submodule', 'init']) + subprocess.check_call(['git', 'submodule', 'update']) + except subprocess.CalledProcessError: print 'sugar-jhbuild update failed.' import main -- cgit v0.9.1