From e66dcf258c4abc8217f55807108a5a627a67b7f1 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Fri, 11 Dec 2015 08:28:51 +0000 Subject: [PATCH] `curl` bundled with Anaconda does not work on Debian --- pyenv.d/which/anaconda.bash | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pyenv.d/which/anaconda.bash b/pyenv.d/which/anaconda.bash index 77d8cd58..08ea2b83 100644 --- a/pyenv.d/which/anaconda.bash +++ b/pyenv.d/which/anaconda.bash @@ -146,8 +146,20 @@ lookup_from_path() { echo "$result" } -if [ -n "$PYENV_COMMAND" ] && [ ! -x "$PYENV_COMMAND_PATH" ]; then - if conda_exists && conda_shims | grep -q -x "$PYENV_COMMAND"; then - PYENV_COMMAND_PATH="$(lookup_from_path "$PYENV_COMMAND" || true)" +if [ -n "$PYENV_COMMAND" ]; then + if conda_exists; then + if [ -x "$PYENV_COMMAND_PATH" ]; then + # `curl` bundled with Anaconda does not work on Debian + # https://github.com/ContinuumIO/anaconda-issues/issues/72 + if [[ "$PYENV_COMMAND" == "curl" ]] && [[ -x "${PYENV_COMMAND_PATH%/*}/curl-config" ]]; then + if [ ! -f "$("${PYENV_COMMAND_PATH%/*}/curl-config" --ca 2>/dev/null || true)" ]; then + PYENV_COMMAND_PATH="$(lookup_from_path "$PYENV_COMMAND" || true)" + fi + fi + else + if conda_shims | grep -q -x "$PYENV_COMMAND"; then + PYENV_COMMAND_PATH="$(lookup_from_path "$PYENV_COMMAND" || true)" + fi + fi fi fi