1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-11 13:03:46 -05:00

add CPython development versions (2.[67]-dev, 3.[1234]-dev)

This commit is contained in:
Yamashita Yuu
2013-05-21 16:38:11 +09:00
parent b3deef5e80
commit 9ae12a7c22
10 changed files with 185 additions and 2 deletions

View File

@@ -148,8 +148,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.
export PYENV_VERSION="$(pyenv global 2>/dev/null || true)"
# Default PYENV_VERSION to the globally-specified Python version. (The
# Python 3.4 installer requires an existing Python installation to run. An
# unsatisfied local .python-version file can cause the installer to
# fail.)
if [ -z "${PYENV_VERSION}" ]; then
export PYENV_VERSION="$(pyenv global 2>/dev/null || true)"
fi
# Execute `before_install` hooks.

View File

@@ -104,6 +104,10 @@ install_git() {
install_package_using "git" 2 "$@"
}
install_hg() {
install_package_using "hg" 2 "$@"
}
install_svn() {
install_package_using "svn" 2 "$@"
}
@@ -355,6 +359,38 @@ fetch_git() {
fi
}
fetch_hg() {
local package_name="$1"
local hg_url="$2"
local hg_ref="$3"
echo "Cloning ${hg_url}..." >&2
if type hg &>/dev/null; then
if [ -n "$PYTHON_BUILD_CACHE_PATH" ]; then
pushd "$PYTHON_BUILD_CACHE_PATH" >&4
local clone_name="$(sanitize "$hg_url")"
if [ -e "${clone_name}" ]; then
{ cd "${clone_name}"
hg pull --force "$hg_url"
} >&4 2>&1
else
{ hg clone --branch "$hg_ref" "$hg_url" "${clone_name}"
cd "${clone_name}"
hg update null
} >&4 2>&1
fi
hg_url="$PYTHON_BUILD_CACHE_PATH/${clone_name}"
popd >&4
fi
hg clone --branch "$hg_ref" "$hg_url" "${package_name}" >&4 2>&1
else
echo "error: please install \`hg\` and try again" >&2
exit 1
fi
}
fetch_svn() {
local package_name="$1"
local svn_url="$2"