aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-11-08 17:39:53 +0100
committerGerald Combs <gerald@wireshark.org>2018-11-08 17:26:03 +0000
commite5cd75557872597182820c22ea581e9640eb5ef4 (patch)
tree81722a0d20aeb70cbf0eac4196604cc11dc8297f
parent7f2cf2fccaff3cbdfc0f3a43a10667269f4ea4f6 (diff)
macos-setup.sh: fix Python 3 installation for OS X 10.8 and older
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 <gerald@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
-rwxr-xr-xtools/macos-setup.sh11
1 files 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=""