blob: 81465475124a637dc5410f11f7b16360f190a809 (
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
|
#!/usr/bin/env python
import os
import sys
import subprocess
import optparse
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)
parser = optparse.OptionParser()
parser.disable_interspersed_args()
options, args = parser.parse_args(sys.argv[1:])
if os.path.exists(jhbuild_dir):
if not args or args[0] in ('build', 'update'):
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:]))
|