2015-06-08 20:18:51 -03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "Checking modules"
|
|
|
|
|
2016-09-09 04:11:17 -03:00
|
|
|
MODULE_LIST="gbenchmark gtest mavlink mavlink/pymavlink PX4Firmware PX4Firmware/src/lib/matrix PX4Firmware/Tools/gencpp PX4Firmware/Tools/genmsg PX4NuttX uavcan uavcan/dsdl uavcan/libuavcan/dsdl_compiler/pyuavcan waf"
|
2015-06-08 20:18:51 -03:00
|
|
|
|
|
|
|
NEED_INIT=0
|
|
|
|
|
2016-04-12 19:01:18 -03:00
|
|
|
export GIT_PAGER=cat
|
|
|
|
|
2015-06-08 20:18:51 -03:00
|
|
|
cd $(dirname "$0")/.. || exit 1
|
|
|
|
|
|
|
|
for m in $MODULE_LIST; do
|
|
|
|
[ -d modules/$m ] || {
|
2016-01-02 01:03:59 -04:00
|
|
|
echo "modules/$m missing - need module init"
|
2015-06-08 20:18:51 -03:00
|
|
|
NEED_INIT=1
|
|
|
|
break
|
|
|
|
}
|
2015-06-08 23:34:09 -03:00
|
|
|
[ -f modules/$m/.git ] || {
|
2016-01-02 01:03:59 -04:00
|
|
|
echo "modules/$m/.git missing - need module init"
|
2015-06-08 23:34:09 -03:00
|
|
|
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"
|
2016-03-09 02:26:27 -04:00
|
|
|
git submodule status --recursive
|
2015-06-08 20:18:51 -03:00
|
|
|
exit 1
|
|
|
|
}
|
2016-04-12 22:00:45 -03:00
|
|
|
for m in $MODULE_LIST; do
|
|
|
|
[ -f modules/$m/.gitmodules ] && {
|
|
|
|
(cd modules/$m && git submodule init) || {
|
|
|
|
echo "init of $m failed"
|
|
|
|
git submodule status --recursive
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
done
|
2016-01-31 00:46:59 -04:00
|
|
|
git submodule update --recursive || {
|
2015-06-08 20:18:51 -03:00
|
|
|
echo "git submodule update failed"
|
2016-03-09 02:26:27 -04:00
|
|
|
git submodule status --recursive
|
2015-06-08 20:18:51 -03:00
|
|
|
exit 1
|
|
|
|
}
|
2016-03-04 00:27:19 -04:00
|
|
|
for m in $MODULE_LIST; do
|
|
|
|
[ -d modules/$m ] || {
|
|
|
|
echo "modules/$m missing - failed module init"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
[ -f modules/$m/.git ] || {
|
|
|
|
echo "modules/$m/.git missing - failed module init"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
done
|
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'
|
|
|
|
|
2021-05-26 23:33:17 -03:00
|
|
|
Please see https://ardupilot.org/dev/docs/git-submodules.html
|
2015-06-09 00:51:15 -03:00
|
|
|
EOF
|
2015-06-08 20:18:51 -03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|