px4-firmware/Tools/check_submodules.sh

41 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/sh
2014-07-07 12:35:47 -03:00
[ -n "$GIT_SUBMODULES_ARE_EVIL" ] && {
# GIT_SUBMODULES_ARE_EVIL is set, meaning user doesn't want submodules
echo "Skipping submodules. NUTTX_SRC is set to $NUTTX_SRC"
exit 0
}
2014-07-07 12:35:47 -03:00
if [ -d NuttX/nuttx ];
then
2014-07-07 17:20:55 -03:00
STATUSRETVAL=$(git status --porcelain | grep -i "NuttX")
2014-07-07 12:35:47 -03:00
if [ "$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-07 17:20:55 -03:00
echo "NuttX sub repo not at correct version. Try 'make updatesubmodules'"
2014-07-07 12:35:47 -03:00
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
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-07 17:20:55 -03:00
STATUSRETVAL=$(git status --porcelain | grep -i "mavlink/include/mavlink/v1.0")
2014-07-07 12:35:47 -03:00
if [ "$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-07 17:20:55 -03:00
echo "mavlink sub repo not at correct version. Try 'make updatesubmodules'"
2014-07-07 12:35:47 -03:00
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
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
exit 0