2018-09-02 14:01:41 -03:00
|
|
|
#!/usr/bin/env python
|
2016-08-01 15:47:27 -03:00
|
|
|
|
|
|
|
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')
|
|
|
|
|
2018-08-06 23:49:05 -03:00
|
|
|
python = sys.executable
|
|
|
|
|
2016-08-01 15:47:27 -03:00
|
|
|
try:
|
2018-08-06 23:49:05 -03:00
|
|
|
subprocess.check_call([python, waf_light] + sys.argv[1:])
|
2016-08-26 01:34:17 -03:00
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
|
if e.returncode != 2 or p.isfile(waf_light):
|
2016-09-29 08:53:35 -03:00
|
|
|
sys.exit(1)
|
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')
|