mirror of
https://github.com/pyenv/pyenv.git
synced 2025-01-22 23:11:15 +00:00
update base version of ruby-build (v20130518)
This commit is contained in:
parent
0bf26d8f1d
commit
b3deef5e80
2 changed files with 29 additions and 3 deletions
|
@ -148,6 +148,9 @@ 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)"
|
||||
|
||||
|
||||
# Execute `before_install` hooks.
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PYTHON_BUILD_VERSION="20121023"
|
||||
PYTHON_BUILD_VERSION="20130518"
|
||||
|
||||
set -E
|
||||
exec 3<&2 # preserve original stderr at fd 3
|
||||
|
@ -61,6 +61,10 @@ capitalize() {
|
|||
printf "%s" "$1" | tr a-z A-Z
|
||||
}
|
||||
|
||||
sanitize() {
|
||||
printf "%s" "$1" | sed "s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
|
||||
}
|
||||
|
||||
build_failed() {
|
||||
{ echo
|
||||
echo "BUILD FAILED"
|
||||
|
@ -330,6 +334,20 @@ fetch_git() {
|
|||
echo "Cloning ${git_url}..." >&2
|
||||
|
||||
if type git &>/dev/null; then
|
||||
if [ -n "$PYTHON_BUILD_CACHE_PATH" ]; then
|
||||
pushd "$PYTHON_BUILD_CACHE_PATH" >&4
|
||||
local clone_name="$(sanitize "$git_url")"
|
||||
if [ -e "${clone_name}" ]; then
|
||||
{ cd "${clone_name}"
|
||||
git fetch --force "$git_url" "+${git_ref}:${git_ref}"
|
||||
} >&4 2>&1
|
||||
else
|
||||
git clone --bare --branch "$git_ref" "$git_url" "${clone_name}" >&4 2>&1
|
||||
fi
|
||||
git_url="$PYTHON_BUILD_CACHE_PATH/${clone_name}"
|
||||
popd >&4
|
||||
fi
|
||||
|
||||
git clone --depth 1 --branch "$git_ref" "$git_url" "${package_name}" >&4 2>&1
|
||||
else
|
||||
echo "error: please install \`git\` and try again" >&2
|
||||
|
@ -476,8 +494,13 @@ build_package_standard() {
|
|||
local PACKAGE_MAKE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]"
|
||||
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
||||
|
||||
{ CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}" ${!PACKAGE_CONFIGURE:-./configure} --prefix="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}" $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS} "${!PACKAGE_CONFIGURE_OPTS_ARRAY}"
|
||||
"$MAKE" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} "${!PACKAGE_MAKE_OPTS_ARRAY}"
|
||||
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
|
||||
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
|
||||
fi
|
||||
${!PACKAGE_CONFIGURE:-./configure} --prefix="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}" $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS} "${!PACKAGE_CONFIGURE_OPTS_ARRAY}"
|
||||
) >&4 2>&1
|
||||
|
||||
{ "$MAKE" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} "${!PACKAGE_MAKE_OPTS_ARRAY}"
|
||||
"$MAKE" install
|
||||
} >&4 2>&1
|
||||
|
||||
|
|
Loading…
Reference in a new issue