2015-06-08 20:18:51 -03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "Checking modules"
|
|
|
|
|
|
|
|
MODULE_LIST="PX4Firmware PX4NuttX uavcan"
|
|
|
|
|
|
|
|
NEED_INIT=0
|
|
|
|
|
|
|
|
cd $(dirname "$0")/.. || exit 1
|
|
|
|
|
|
|
|
for m in $MODULE_LIST; do
|
|
|
|
[ -d modules/$m ] || {
|
|
|
|
echo "module/$m missing - need module init"
|
|
|
|
NEED_INIT=1
|
|
|
|
break
|
|
|
|
}
|
2015-06-08 23:34:09 -03:00
|
|
|
[ -f modules/$m/.git ] || {
|
|
|
|
echo "module/$m/.git missing - need module init"
|
|
|
|
NEED_INIT=1
|
|
|
|
break
|
|
|
|
}
|
2015-06-08 20:18:51 -03:00
|
|
|
done
|
|
|
|
|
|
|
|
[ $NEED_INIT = 1 ] && {
|
|
|
|
set -x
|
|
|
|
git submodule init || {
|
|
|
|
echo "git submodule init failed"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
git submodule update || {
|
|
|
|
echo "git submodule update failed"
|
|
|
|
exit 1
|
|
|
|
}
|
2015-06-08 23:36:44 -03:00
|
|
|
cat <<EOF
|
|
|
|
==============================
|
|
|
|
git submodules are initialised
|
|
|
|
|
2015-06-09 00:51:15 -03:00
|
|
|
Please see http://dev.ardupilot.com/wiki/git-submodules/
|
|
|
|
|
2015-06-08 23:36:44 -03:00
|
|
|
Please restart the build
|
|
|
|
==============================
|
|
|
|
EOF
|
|
|
|
exit 1
|
2015-06-08 20:18:51 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
for m in $MODULE_LIST; do
|
|
|
|
RET=$(git submodule summary modules/$m | egrep "^..<")
|
|
|
|
[ -z "$RET" ] || {
|
|
|
|
echo "Module modules/$m out of date"
|
|
|
|
git submodule summary modules/$m
|
2015-06-09 00:51:15 -03:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
You need to run 'git submodule update'
|
|
|
|
|
|
|
|
Please see http://dev.ardupilot.com/wiki/git-submodules/
|
|
|
|
EOF
|
2015-06-08 20:18:51 -03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|