2014-07-07 10:25:32 -03:00
|
|
|
#!/bin/sh
|
2014-07-07 12:35:47 -03:00
|
|
|
|
2014-07-08 07:24:18 -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
|
2014-07-07 10:25:32 -03:00
|
|
|
else
|
2014-07-07 12:35:47 -03:00
|
|
|
git submodule init;
|
|
|
|
git submodule update;
|
2014-07-07 10:25:32 -03:00
|
|
|
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
|
|
|
|
|
2014-07-07 10:25:32 -03:00
|
|
|
exit 0
|