store distribute/setuptools archive in $PYTHON_BUILD_CACHE_PATH to reuse

them between invocations.
This commit is contained in:
Yamashita Yuu
2013-04-30 19:55:49 +09:00
parent aec759a0e0
commit 0f8477fcf5

View File

@@ -133,8 +133,14 @@ fi
VIRTUALENV_NAME="${ARGUMENTS[1]##*/}" VIRTUALENV_NAME="${ARGUMENTS[1]##*/}"
VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}" VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}"
# create virtualenv # virtualenv may download distribute/setuptools in current directory.
"${PYTHON_BIN}" "${VIRTUALENV}" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}" # change to cache directory to reuse them between invocation.
VIRTUALENV_CACHE_PATH="${PYTHON_BUILD_CACHE_PATH:-${PYENV_ROOT}/cache}"
mkdir -p "${VIRTUALENV_CACHE_PATH}"
{
cd "${VIRTUALENV_CACHE_PATH}"
"${PYTHON_BIN}" "${VIRTUALENV}" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}"
}
# create symlink of `python' bound for actual executable # create symlink of `python' bound for actual executable
if [ ! -f "$VIRTUALENV_PYTHON_BIN" ]; then if [ ! -f "$VIRTUALENV_PYTHON_BIN" ]; then