diff options
-rwxr-xr-x | state/gen | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -6,23 +6,24 @@ cd "$(dirname "$0")" # do not run anything if make was run with -n (dry run) [ "${MAKEFLAGS#*n}" != "$MAKEFLAGS" ] && exit -touch_rm_exit_code() { - PREV_EC="$?" - if [ "$PREV_EC" -eq 0 ] ; then - ! [ -e "$1" ] && touch "$1" - else - rm -f "$1" - fi - return "$PREV_EC" -} - # container image (initialized here, updated in makefile) $CTR image exists "$CTR_IMG_TAG" 1> /dev/null 2> /dev/null -touch_rm_exit_code container_img +if [ $? -eq 0 ] ; then + ! [ -e container_img ] && touch container_img +else + rm -f container_img +fi # check if all the submodules are initialized -test -z "$(git submodule status | grep '^-')" -touch_rm_exit_code submodules +touch submodules +MODULES="$(git config \ + --file "$(git rev-parse --show-toplevel)/.gitmodules" \ + --name-only --get-regexp path |\ + sed -e 's/^submodule\./modules\//' -e 's/\.path$/\/HEAD/')" +for git_module in $MODULES ; do + git rev-parse "$git_module" 1> /dev/null 2> /dev/null && continue + rm -f submodules +done rm -f sdcard_part sdcard_fmt # if no explicit SDCARD_DISK is set, guess which device is the sd card by |