px4-firmware/Tools/check_submodules.sh

65 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/sh
2014-07-07 12:35:47 -03:00
if [ -d NuttX/nuttx ];
then
2014-07-10 11:14:21 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i "NuttX" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
2014-07-07 17:20:55 -03:00
echo "Checked NuttX submodule, correct version found"
2014-07-07 12:35:47 -03:00
else
2014-07-10 11:14:21 -03:00
echo ""
echo ""
echo "NuttX sub repo not at correct version. Try 'git submodule update'"
2014-07-07 12:35:47 -03:00
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
2014-07-10 11:14:21 -03:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
2014-07-07 12:35:47 -03:00
exit 1
fi
else
2014-07-07 12:35:47 -03:00
git submodule init;
git submodule update;
fi
2014-07-07 12:35:47 -03:00
if [ -d mavlink/include/mavlink/v1.0 ];
then
2014-07-10 11:14:21 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i "mavlink/include/mavlink/v1.0" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
2014-07-07 17:20:55 -03:00
echo "Checked mavlink submodule, correct version found"
2014-07-07 12:35:47 -03:00
else
2014-07-10 11:14:21 -03:00
echo ""
echo ""
echo "mavlink sub repo not at correct version. Try 'git submodule update'"
2014-07-07 12:35:47 -03:00
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
2014-07-10 11:14:21 -03:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
2014-07-07 12:35:47 -03:00
exit 1
fi
2014-07-07 12:18:54 -03:00
else
2014-07-07 12:35:47 -03:00
git submodule init;
git submodule update;
2014-07-07 12:18:54 -03:00
fi
2014-07-08 13:19:17 -03:00
if [ -d uavcan/libuavcan_drivers ];
then
STATUSRETVAL=$(git status --porcelain | grep -i uavcan)
if [ "$STATUSRETVAL" == "" ]; then
echo "Checked uavcan submodule, correct version found"
else
echo "uavcan sub repo not at correct version. Try 'make updatesubmodules'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule init
git submodule update
fi
exit 0