From 8fa6b4a1847851919ad7857c6c42ed809a4d277b Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Tue, 19 Nov 2013 17:58:58 +0900 Subject: [PATCH] CPython installer requires existing Pyhthon of similar version. --- plugins/python-build/bin/pyenv-install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/python-build/bin/pyenv-install b/plugins/python-build/bin/pyenv-install index 9dbe9094..f862d4cf 100755 --- a/plugins/python-build/bin/pyenv-install +++ b/plugins/python-build/bin/pyenv-install @@ -156,11 +156,13 @@ if [ -z "${PYTHON_BUILD_CACHE_PATH}" ] && [ -d "${PYENV_ROOT}/cache" ]; then export PYTHON_BUILD_CACHE_PATH="${PYENV_ROOT}/cache" fi -# Default PYENV_VERSION to the globally-specified Python version. (The +# Default PYENV_VERSION to the friendly Python version. (The # CPython installer requires an existing Python installation to run. An -# unsatisfied local .python-version file can cause the installer to +# unsatisfied local python version can cause the installer to # fail.) -#export PYENV_VERSION="$(pyenv global 2>/dev/null || true)" +if [[ "${VERSION_NAME}" == [23]"."* ]]; then + export PYENV_VERSION="$(pyenv-whence "python${VERSION_NAME%%.${VERSION_NAME##*.}}" 2>/dev/null | tail -1 || true)" +fi # Execute `before_install` hooks.