From a33994584837479e75e1655919dc6c4fb23df8bc Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 6 Jun 2020 18:45:28 -0600 Subject: [PATCH] Prefer the python3 in /usr/bin on Solaris. The /opt/csw version, if it exists, may be a 32-bit version which we can't link with. Also handle the case where the /usr/bin/python3 link is missing. --- scripts/mkpkg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/mkpkg b/scripts/mkpkg index 988d7e086..73eb4e8b2 100755 --- a/scripts/mkpkg +++ b/scripts/mkpkg @@ -411,6 +411,22 @@ case "$osversion" in with_openssl=true # Python plugins with_python=true + + # We prefer the system version of python3 to the + # csw one (which may be 32-bit) + if [ -z "$PYTHON" ]; then + if [ -x /usr/bin/python3 ]; then + PYTHON="/usr/bin/python3"; export PYTHON + else + # Sometimes the /usr/bin/python3 is missing + for f in /usr/bin/python3.9 /usr/bin/python3.8 /usr/bin/python3.7 /usr/bin/python3.6 /usr/bin/python3.5 /usr/bin/python3.4 /usr/bin/python3.3 /usr/bin/python3.2 /usr/bin/python3.1 /usr/bin/python3.0; do + if [ -x $f ]; then + PYTHON="$f"; export PYTHON + break + fi + done + fi + fi fi ;; *)