Since commit 9c0c7846cd (support/dependencies: don't check for python
on the host), we no longer check for a host python interpreter installed
on the system.
Drop the comment in support/dependencies/check-host-python3.sh, as it is
now confusing.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Julien Olivain <ju.o@free.fr>
30 lines
636 B
Bash
Executable File
30 lines
636 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# prevent shift error
|
|
[ $# -lt 2 ] && exit 1
|
|
|
|
version_min="$(echo ${1} | awk '{ split($1, v, "."); print v[1] v[2] }')"
|
|
|
|
shift
|
|
|
|
# We want to check the version number of the python3 interpreter even
|
|
# if Buildroot is able to use any version but some packages may require
|
|
# a more recent version.
|
|
|
|
for candidate in "${@}" ; do
|
|
python3=`which $candidate 2>/dev/null`
|
|
if [ ! -x "$python3" ]; then
|
|
continue
|
|
fi
|
|
version=`$python3 -V 2>&1 | awk '{ split($2, v, "."); print v[1] v[2] }'`
|
|
|
|
if [ $version -lt $version_min ]; then
|
|
# no suitable python3 found
|
|
continue
|
|
fi
|
|
|
|
# suitable python3 found
|
|
echo $python3
|
|
break
|
|
done
|