mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Create symlinks for executables with version suffix (#182)
This commit is contained in:
parent
d496c03497
commit
5c91bc981c
1 changed files with 18 additions and 4 deletions
|
@ -1246,15 +1246,29 @@ apply_python_patch() {
|
|||
}
|
||||
|
||||
verify_python() {
|
||||
local python="$1"
|
||||
local python="${1##python}"
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
# Only symlinks are installed in ${PREFIX_PATH}/bin
|
||||
rm -fr "${PREFIX_PATH}/bin"
|
||||
ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/bin" "${PREFIX_PATH}/bin"
|
||||
fi
|
||||
if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" )
|
||||
|
||||
# Create symlinks
|
||||
local suffix="${1##python}"
|
||||
local file link
|
||||
for file in "${PREFIX_PATH}/bin"/*; do
|
||||
if [[ "${file##*/}" == *"${suffix}" ]]; then
|
||||
if [[ "${file}" == *"-${suffix}" ]]; then
|
||||
link="${file%%-${suffix}}"
|
||||
else
|
||||
link="${file%%${suffix}}"
|
||||
fi
|
||||
if [ ! -e "${link}" ]; then
|
||||
( cd "${file%/*}" && ln -fs "${file##*/}" "${link##*/}" )
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -x "${PYTHON_BIN}" ]; then
|
||||
{ colorize 1 "ERROR"
|
||||
echo ": invalid Python executable: ${PYTHON_BIN}"
|
||||
|
|
Loading…
Reference in a new issue