2016-08-01 15:47:27 -03:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
from __future__ import print_function
|
2016-08-26 01:34:17 -03:00
|
|
|
import subprocess
|
2016-08-01 15:47:27 -03:00
|
|
|
import os.path as p
|
|
|
|
import sys
|
|
|
|
|
|
|
|
d = p.dirname(p.realpath(__file__))
|
2016-08-26 01:34:17 -03:00
|
|
|
waf_light = p.join(d, 'modules', 'waf', 'waf-light')
|
|
|
|
|
2016-08-01 15:47:27 -03:00
|
|
|
try:
|
2016-08-26 01:34:17 -03:00
|
|
|
subprocess.check_call(['python', waf_light] + sys.argv[1:])
|
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
|
if e.returncode != 2 or p.isfile(waf_light):
|
|
|
|
raise e
|
2016-08-01 15:47:27 -03:00
|
|
|
|
2016-08-26 01:34:17 -03:00
|
|
|
print('Missing waf submodule. Trying to get it')
|
2016-08-01 15:47:27 -03:00
|
|
|
|
|
|
|
try:
|
2016-08-26 01:34:17 -03:00
|
|
|
subprocess.check_call(['git', 'submodule', 'update', '--init',
|
|
|
|
'modules/waf'])
|
|
|
|
except subprocess.CalledProcessError:
|
2016-08-01 15:47:27 -03:00
|
|
|
print('Could not update submodule', file=sys.stderr)
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
print('Submodules OK, try running again')
|