waf: git_submodule: support recursive submodules

This commit is contained in:
Gustavo Jose de Sousa 2016-03-08 11:06:13 -03:00 committed by Lucas De Marchi
parent d57851e2a9
commit 6753b54b52
1 changed files with 5 additions and 4 deletions

View File

@ -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