From e5cd75557872597182820c22ea581e9640eb5ef4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 8 Nov 2018 17:39:53 +0100 Subject: [PATCH] macos-setup.sh: fix Python 3 installation for OS X 10.8 and older MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3c5b7fa272fbef770b06430edadb8abfc688e951 Fixes: v2.9.0rc0-2460-ge9f7bb5127 ("Require Python 3, drop Python 2 support") Reviewed-on: https://code.wireshark.org/review/30548 Reviewed-by: Gerald Combs Reviewed-by: Michael Tüxen --- tools/macos-setup.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/macos-setup.sh b/tools/macos-setup.sh index 4b5864ded2..7cce6388e1 100755 --- a/tools/macos-setup.sh +++ b/tools/macos-setup.sh @@ -1702,11 +1702,17 @@ uninstall_json_glib() { } install_python3() { + local macver=10.9 + if [[ $DARWIN_MAJOR_VERSION -lt 13 ]]; then + # The 64-bit installer requires 10.9 (Mavericks), use the 64-bit/32-bit + # variant for 10.6 (Snow Leopard) and newer. + macver=10.6 + fi if [ "$PYTHON3_VERSION" -a ! -f python3-$PYTHON3_VERSION-done ] ; then echo "Downloading and installing python3:" - [ -f python-$PYTHON3_VERSION-macosx10.9.pkg ] || curl -L -O https://www.python.org/ftp/python/$PYTHON3_VERSION/python-$PYTHON3_VERSION-macosx10.9.pkg || exit 1 + [ -f python-$PYTHON3_VERSION-macosx$macver.pkg ] || curl -L -O https://www.python.org/ftp/python/$PYTHON3_VERSION/python-$PYTHON3_VERSION-macosx$macver.pkg || exit 1 $no_build && echo "Skipping installation" && return - sudo installer -target / -pkg python-$PYTHON3_VERSION-macosx10.9.pkg || exit 1 + sudo installer -target / -pkg python-$PYTHON3_VERSION-macosx$macver.pkg || exit 1 touch python3-$PYTHON3_VERSION-done fi } @@ -1738,6 +1744,7 @@ uninstall_python3() { # Get rid of the previously downloaded and unpacked version. # rm -f python-$installed_python3_version-macosx10.9.pkg + rm -f python-$installed_python3_version-macosx10.6.pkg fi installed_python3_version=""