From c5cc832304b3ebff1d19c33f125337ae6972f79d Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 16 Feb 2023 12:52:07 -0500 Subject: [PATCH] check maximum value of python version as well as minimum --- installer/install.sh.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/installer/install.sh.in b/installer/install.sh.in index e78023dfcd..25b0a2035a 100755 --- a/installer/install.sh.in +++ b/installer/install.sh.in @@ -9,13 +9,16 @@ cd $scriptdir function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } MINIMUM_PYTHON_VERSION=3.9.0 +MAXIMUM_PYTHON_VERSION=3.11.0 PYTHON="" -for candidate in python3.10 python3.9 python3 python python3.11 ; do +for candidate in python3.10 python3.9 python3 python ; do if ppath=`which $candidate`; then python_version=$($ppath -V | awk '{ print $2 }') if [ $(version $python_version) -ge $(version "$MINIMUM_PYTHON_VERSION") ]; then - PYTHON=$ppath - break + if [ $(version $python_version) -lt $(version "$MAXIMUM_PYTHON_VERSION") ]; then + PYTHON=$ppath + break + fi fi fi done