From 4c8eeebbffee23054d25aed7b562048dc0ff5d40 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 12 Jan 2016 00:30:50 +0000 Subject: [PATCH] Add missing declaration of `virtualenv_prefix` to fix looking up executables from source version (#62) --- etc/pyenv.d/which/system-site-packages.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/pyenv.d/which/system-site-packages.bash b/etc/pyenv.d/which/system-site-packages.bash index 6bfb0aa..8283793 100644 --- a/etc/pyenv.d/which/system-site-packages.bash +++ b/etc/pyenv.d/which/system-site-packages.bash @@ -37,8 +37,12 @@ if [ ! -x "${PYENV_COMMAND_PATH}" ]; then if [ ! -f "${no_global_site_packages}" ]; then include_system_site_packages=1 fi + virtualenv_orig_prefix="$(find "${virtualenv_libpath}/" -maxdepth 2 -type f -and -name "orig-prefix.txt" 2>/dev/null | head -1)" + if [ -f "${virtualenv_orig_prefix}" ]; then + virtualenv_prefix="$(cat "${virtualenv_orig_prefix}" 2>/dev/null || true)" + fi fi - if [ -n "${include_system_site_packages}" ]; then + if [ -n "${include_system_site_packages}" ] && [ -n "${virtualenv_prefix}" ]; then # virtualenv is created with `--system-site-packages` virtualenv_command_path="${virtualenv_prefix}/bin/${PYENV_COMMAND_PATH##*/}" if [ -x "${virtualenv_command_path}" ]; then