aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-23 17:27:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-23 17:27:58 +0200
commit63bc8d7b34cd0ed089a58473332323b180a438ce (patch)
treed4b5c8d2798b53b7599fad5c5dd6b9ac9db619b4
parentbf3ebb41333cef376cdeeff610a2097db7831a0e (diff)
Handle recursive submodules in check script
-rwxr-xr-xcheck31
1 files 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 () # <dir>
+{
+ # 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