From eef8ac2701497947e3031d81e8a3033f607e8593 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sun, 19 Oct 2014 00:13:49 +0900 Subject: [PATCH] Use version suffixed executable (e.g. `python3.4`) for internal use of python (#255) --- plugins/python-build/bin/python-build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index c9cc5080..8f45f894 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1687,9 +1687,25 @@ if [[ "Darwin" == "$(uname -s)" ]]; then fi fi +python_bin_suffix() { + local version_name version_info + case "$1" in + 2.* | 3.* ) + version_name="$1" + version_info=(${version_name//./ }) + echo "${version_info[0]}.${version_info[1]}" + ;; + stackless-2.* | stackless-3.* ) + version_name="${1#stackless-}" + version_info=(${version_name//./ }) + echo "${version_info[0]}.${version_info[1]}" + ;; + esac +} + SEED="$(date "+%Y%m%d%H%M%S").$$" LOG_PATH="${TMP}/python-build.${SEED}.log" -PYTHON_BIN="${PREFIX_PATH}/bin/python" +PYTHON_BIN="${PREFIX_PATH}/bin/python$(python_bin_suffix "${DEFINITION_PATH##*/}")" CWD="$(pwd)" if [ -z "$PYTHON_BUILD_BUILD_PATH" ]; then