Browse Source

Improve submodule checking

sbg
Lorenz Meier 10 years ago
parent
commit
37ec1ec8de
  1. 7
      Makefile
  2. 59
      Tools/check_submodules.sh

7
Makefile

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. # Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@ -161,7 +161,7 @@ $(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config))))
# #
NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export) NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export)
.PHONY: archives .PHONY: archives
archives: $(NUTTX_ARCHIVES) archives: checksubmodules $(NUTTX_ARCHIVES)
# We cannot build these parallel; note that we also force -j1 for the # We cannot build these parallel; note that we also force -j1 for the
# sub-make invocations. # sub-make invocations.
@ -211,8 +211,7 @@ menuconfig:
@$(ECHO) "" @$(ECHO) ""
endif endif
$(NUTTX_SRC): $(NUTTX_SRC): checksubmodules
$(Q) ($(PX4_BASE)/Tools/check_submodules.sh)
$(UAVCAN_DIR): $(UAVCAN_DIR):
$(Q) (./Tools/check_submodules.sh) $(Q) (./Tools/check_submodules.sh)

59
Tools/check_submodules.sh

@ -12,17 +12,16 @@ if [ -d NuttX/nuttx ];
if [ -z "$STATUSRETVAL" ]; then if [ -z "$STATUSRETVAL" ]; then
echo "Checked NuttX submodule, correct version found" echo "Checked NuttX submodule, correct version found"
else else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo "" echo ""
echo "" echo ""
echo " NuttX sub repo not at correct version. Try 'git submodule update'" echo " NuttX sub repo not at correct version. Try 'git submodule update'"
echo " or follow instructions on http://pixhawk.org/dev/git/submodules" echo " or follow instructions on http://pixhawk.org/dev/git/submodules"
echo "" echo ""
echo " DO NOT FORGET TO RUN 'make distclean && make archives' AFTER EACH NUTTX UPDATE!" echo " DO NOT FORGET TO RUN 'make distclean && make archives' AFTER EACH NUTTX UPDATE!"
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
exit 1 exit 1
fi fi
else else
@ -37,15 +36,14 @@ if [ -d mavlink/include/mavlink/v1.0 ];
if [ -z "$STATUSRETVAL" ]; then if [ -z "$STATUSRETVAL" ]; then
echo "Checked mavlink submodule, correct version found" echo "Checked mavlink submodule, correct version found"
else else
echo ""
echo ""
echo "mavlink sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
echo "" echo ""
echo "" echo ""
echo "New commits required:" echo "New commits required:"
echo "$(git submodule summary)" echo "$(git submodule summary)"
echo "" echo ""
echo ""
echo "mavlink sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1 exit 1
fi fi
else else
@ -61,15 +59,58 @@ then
then then
echo "Checked uavcan submodule, correct version found" echo "Checked uavcan submodule, correct version found"
else else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo "" echo ""
echo "" echo ""
echo "uavcan sub repo not at correct version. Try 'git submodule update'" echo "uavcan sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules" echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule init;
git submodule update;
fi
if [ -d Tools/gencpp ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i gencpp | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked gencpp submodule, correct version found"
else
echo "" echo ""
echo "" echo ""
echo "New commits required:" echo "New commits required:"
echo "$(git submodule summary)" echo "$(git submodule summary)"
echo "" echo ""
echo ""
echo "gencpp sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule init;
git submodule update;
fi
if [ -d Tools/genmsg ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i genmsg | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked genmsg submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "genmsg sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1 exit 1
fi fi
else else

Loading…
Cancel
Save