From 63bc8d7b34cd0ed089a58473332323b180a438ce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Apr 2016 17:27:58 +0200 Subject: Handle recursive submodules in check script --- check | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/check b/check index 6cbdfa6..a34dff7 100755 --- a/check +++ b/check @@ -75,17 +75,38 @@ if [ "$master" = "y" ]; then fi fi -if [ "$submod" = "y" ]; then - sms=`git -C $dir submodule foreach --quiet --recursive 'echo $path'` +function submod () # +{ + # The --recursive option doesn't produce the complete path so we will + # have to recurse ourselves. + # + local sms=`git -C $1 submodule foreach --quiet 'echo -n "$path "'` + + #info "checking '$sms' in $1..." + + local sm= for sm in $sms; do - smd=$dir/$sm - br=`branch $smd` + local smd=$1/$sm + + #info "sumbodule '$sm' in '$smd'" + + local br=`branch $smd` if ! synced $smd $br; then info "submodule $smd is not updated" - r=1 + return 1 + fi + + if ! submod $smd; then + return 1 fi done +} + +if [ "$submod" = "y" ]; then + if ! submod $dir; then + r=1 + fi fi if [ "$clean" = "y" ]; then -- cgit v1.1