From cd9cb8d4a2a9d75cd995666dd238c7faf100be93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6ppe?= Date: Thu, 25 Jan 2024 21:29:27 -0800 Subject: [PATCH] `tools/dependency-check.sh`: Avoid confusing error message (#4423) --- tools/dependency-check.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/dependency-check.sh b/tools/dependency-check.sh index 6cf3ff784..1ed6268d6 100755 --- a/tools/dependency-check.sh +++ b/tools/dependency-check.sh @@ -6,12 +6,21 @@ failure_exit() { } check_python_version() { + if [ -z "$PYMAJOR$PYMINOR" ]; then + echo >&2 "$0: This script expects that environment variables PYMAJOR and PYMINOR are set; skipping check_python_version" + return + fi if ! command -v python"$PYMAJOR"."$PYMINOR" &> /dev/null; then echo >&2 "Must compile with python $PYMAJOR.$PYMINOR." exit 1 fi } + check_python_headers() { + if [ -z "$PYMAJOR$PYMINOR" ]; then + echo >&2 "$0: This script expects that environment variables PYMAJOR and PYMINOR are set; skipping check_python_headers" + return + fi local python_headers_present python_headers_present=$(pkg-config --libs python-"$PYMAJOR"."$PYMINOR")