mirror of https://github.com/ArduPilot/ardupilot
waf: git_submodule: support recursive submodules
This commit is contained in:
parent
d57851e2a9
commit
6753b54b52
|
@ -40,17 +40,18 @@ import os.path
|
|||
|
||||
class update_submodule(Task.Task):
|
||||
color = 'BLUE'
|
||||
run_str = '${GIT} -C ${SRC_ROOT} submodule update --init -- ${SUBMODULE_PATH}'
|
||||
run_str = '${GIT} -C ${SRC_ROOT} submodule update --recursive --init -- ${SUBMODULE_PATH}'
|
||||
|
||||
def runnable_status(self):
|
||||
e = self.env.get_flat
|
||||
cmd = e('GIT'), '-C', e('SRC_ROOT'), 'submodule', 'status', '--', e('SUBMODULE_PATH')
|
||||
cmd = e('GIT'), '-C', e('SRC_ROOT'), 'submodule', 'status', '--recursive', '--', e('SUBMODULE_PATH')
|
||||
out = self.generator.bld.cmd_and_log(cmd, quiet=Context.BOTH)
|
||||
|
||||
# git submodule status uses a blank prefix for submodules that are up
|
||||
# to date
|
||||
if out[0] != ' ':
|
||||
return Task.RUN_ME
|
||||
for line in out.splitlines():
|
||||
if line[0] != ' ':
|
||||
return Task.RUN_ME
|
||||
|
||||
return Task.SKIP_ME
|
||||
|
||||
|
|
Loading…
Reference in New Issue