2013-04-27 20:55:42 +04:00
|
|
|
#!/usr/bin/env python
|
2013-02-19 01:06:57 +04:00
|
|
|
|
2013-04-27 20:55:42 +04:00
|
|
|
import os
|
|
|
|
import subprocess
|
2013-05-09 17:09:28 +04:00
|
|
|
import sys
|
2013-02-19 01:06:57 +04:00
|
|
|
|
|
|
|
|
2013-04-27 20:55:42 +04:00
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
|
|
DEPOT_TOOLS_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'depot_tools')
|
|
|
|
DEPOT_TOOLS_URL = \
|
|
|
|
'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
|
2013-02-19 01:06:57 +04:00
|
|
|
|
2013-04-27 20:55:42 +04:00
|
|
|
|
|
|
|
def main():
|
|
|
|
os.chdir(SOURCE_ROOT)
|
|
|
|
subprocess.check_call(['git', 'submodule', 'sync'])
|
|
|
|
subprocess.check_call(['git', 'submodule', 'update',
|
|
|
|
'--init', '--recursive'])
|
|
|
|
if not os.path.isdir(DEPOT_TOOLS_DIR):
|
|
|
|
subprocess.check_call(['git', 'clone',
|
|
|
|
DEPOT_TOOLS_URL, DEPOT_TOOLS_DIR])
|
|
|
|
update = os.path.join(SOURCE_ROOT, 'script', 'update')
|
2013-05-09 17:09:28 +04:00
|
|
|
subprocess.check_call([sys.executable, update])
|
2013-04-27 20:55:42 +04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|