Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar-jhbuild
blob: 5a47e0af4551937ffa6441e48c4840a0ecbd30d7 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/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, 'jhbuild')

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...'

        retcode = subprocess.call(['git', 'pull'])
        if retcode:
            print 'Failed to update sugar-jhbuild.'

        cwd = os.getcwd()
        os.chdir(jhbuild_dir)

        retcode = subprocess.call(['git', 'pull'])
        if retcode:
            print 'Failed to update 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 'Failed to clone sugar-jhbuild.'

    os.chdir(cwd)

import main

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