diff --git a/Makefile b/Makefile index 8774db7..138b1c7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYTHON ?= $(shell which python3 >/dev/null && echo python3 || echo python) +PYTHON ?= $(shell command -v python3 >/dev/null && echo python3 || echo python) all $(MAKECMDGOALS): @$(PYTHON) \ @@ -8,7 +8,7 @@ all $(MAKECMDGOALS): $(MAKECMDGOALS) git-submodules: - @if [ ! -f releng/meson/meson.py ]; then \ + @if [ ! -f releng/meson/meson.py ] || git submodule status 2>/dev/null | grep -q '^-'; then \ git submodule update --init --recursive --depth 1; \ fi -include git-submodules diff --git a/configure b/configure index a4d189a..12b51a2 100755 --- a/configure +++ b/configure @@ -1,12 +1,12 @@ #!/bin/sh -[ -z "$PYTHON" ] && PYTHON=$(which python3 >/dev/null && echo python3 || echo python) +[ -z "$PYTHON" ] && PYTHON=$(command -v python3 >/dev/null && echo python3 || echo python) cd $(dirname $0) srcroot=$(pwd) -if [ ! -f releng/meson/meson.py ]; then +if [ ! -f releng/meson/meson.py ] || git submodule status 2>/dev/null | grep -q '^-'; then git submodule update --init --recursive --depth 1 || exit $? fi