Commit bf2cfdd6 authored by robbuckley's avatar robbuckley
Browse files

catch curl errors and exit early

parent 444a6e5f
......@@ -290,8 +290,15 @@ function install_mac_cpython {
local py_stripped=$(strip_ver_suffix $py_version)
local py_inst=$(pyinst_fname_for_version $py_version $py_osx_ver)
local inst_path=$DOWNLOADS_SDIR/$py_inst
local retval=""
mkdir -p $DOWNLOADS_SDIR
curl $MACPYTHON_URL/$py_stripped/${py_inst} > $inst_path
# exit early on curl errors, but dont let it exit the shell
cmd_notexit curl -f $MACPYTHON_URL/$py_stripped/${py_inst} > $inst_path || retval=$?
if [ ${retval:-0} -ne 0 ]; then
echo "Python download failed! Check ${py_inst} exists on the server."
exit $retval
fi
if [ "${py_inst: -3}" == "dmg" ]; then
hdiutil attach $inst_path -mountpoint /Volumes/Python
inst_path=/Volumes/Python/Python.mpkg
......
......@@ -21,7 +21,13 @@ if [ -n "$IS_MACOS" ]; then
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$(macpython_sdk_for_version $MB_PYTHON_VERSION)}
PLAT=${PLAT:-$(macpython_arch_for_version $MB_PYTHON_VERSION)}
# exit early if this cmd is expected to fail (and does)
if [[ -n $OSX_ENV_EXPECT_FAIL ]]; then
expect_return 22 get_macpython_environment $MB_PYTHON_VERSION ${VENV:-""} $MB_PYTHON_OSX_VER
exit 0
fi
get_macpython_environment $MB_PYTHON_VERSION ${VENV:-""} $MB_PYTHON_OSX_VER
source tests/test_python_install.sh
source tests/test_fill_pyver.sh
source tests/test_fill_pypy_ver.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment