Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar-jhbuild
blob: 5f964faf0d411f3820bba2d5de641e96b961cff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

import os
import sys
import subprocess

base_dir = os.path.abspath(os.path.dirname(__file__))
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...'

    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

main.main(sys.argv[1:])