Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar-jhbuild
blob: e0385ba95ce6d143d959993251e82756dd1c1dab (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
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python

import __builtin__
import os
import sys
import subprocess

base_dir = os.path.abspath(os.path.dirname(__file__))

sjhbuild_dir = os.path.join(base_dir, 'sjhbuild')
sys.path.append(sjhbuild_dir)

jhbuild_dir = os.path.join(base_dir, 'jhbuild')
sys.path.append(jhbuild_dir)

__builtin__.__dict__['PKGDATADIR'] = None
__builtin__.__dict__['DATADIR'] = None
__builtin__.__dict__['SRCDIR'] = jhbuild_dir

args = sys.argv[1:]

if os.path.exists(jhbuild_dir):
    if not args or 'build' in args or 'update' in args:
        print 'Updating sugar-jhbuild...'

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

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

        print 'Updating upstream jhbuild...'

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

        os.chdir(cwd)
else:
    cwd = os.getcwd()
    os.chdir(base_dir)

    print 'Cloning upstream jhbuild'
    jhbuild_repo = 'git://git.gnome.org/jhbuild'
    retcode = subprocess.call(['git', 'clone', jhbuild_repo])
    if retcode:
        print 'Failed to clone upstream jhbuild.'

    os.chdir(cwd)

import main

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