set STATUS as non-zero even if the setuptools or pip have failed to

install into pyvenv
This commit is contained in:
Yamashita Yuu
2013-06-20 16:08:54 +09:00
parent f3c5a64281
commit 23a115c12a

View File

@@ -281,7 +281,21 @@ STATUS=0
# change to cache directory to reuse them between invocation. # change to cache directory to reuse them between invocation.
mkdir -p "${PYENV_VIRTUALENV_CACHE_PATH}" mkdir -p "${PYENV_VIRTUALENV_CACHE_PATH}"
cd "${PYENV_VIRTUALENV_CACHE_PATH}" cd "${PYENV_VIRTUALENV_CACHE_PATH}"
venv $QUIET $VERBOSE "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}" || STATUS="$?" venv $QUIET $VERBOSE "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}" && {
if virtualenv_is_pyvenv; then
[ -n "${EZ_SETUP_URL}" ] || EZ_SETUP_URL="https://bitbucket.org/pypa/setuptools/raw/${SETUPTOOLS_VERSION:-0.7.4}/ez_setup.py"
PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python -c 'import setuptools' 1>/dev/null 2>&1 || {
echo "Installing setuptools from ${EZ_SETUP_URL}..." 1>&2
http get "${EZ_SETUP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python
}
[ -n "${GET_PIP_URL}" ] || GET_PIP_URL="https://raw.github.com/pypa/pip/${PIP_VERSION:-master}/contrib/get-pip.py"
PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-which pip 1>/dev/null 2>&1 || {
echo "Installing pip from ${GET_PIP_URL}..." 1>&2
http get "${GET_PIP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python
}
fi
} || STATUS="$?"
# Create symlink of `python' bound for actual executable # Create symlink of `python' bound for actual executable
# TODO: remove this if virtualenv doesn't really need this # TODO: remove this if virtualenv doesn't really need this
@@ -292,18 +306,6 @@ if [ ! -e "${VIRTUALENV_PATH}/bin/python" ]; then
fi fi
fi fi
if virtualenv_is_pyvenv; then
[ -n "${EZ_SETUP_URL}" ] || EZ_SETUP_URL="https://bitbucket.org/pypa/setuptools/raw/${SETUPTOOLS_VERSION:-0.7.4}/ez_setup.py"
PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python -c 'import setuptools' 1>/dev/null 2>&1 || {
http get "${EZ_SETUP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python
}
[ -n "${GET_PIP_URL}" ] || GET_PIP_URL="https://raw.github.com/pypa/pip/${PIP_VERSION:-master}/contrib/get-pip.py"
PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-which pip 1>/dev/null 2>&1 || {
http get "${GET_PIP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python
}
fi
## Migrate previously installed packages from requirements.txt ## Migrate previously installed packages from requirements.txt
if [ -n "$UPGRADE" ]; then if [ -n "$UPGRADE" ]; then
UPGRADE_STATUS=0 UPGRADE_STATUS=0