Create symlinks for executables with version suffix (#182)

This commit is contained in:
Yamashita Yuu 2014-06-11 22:25:34 +09:00
parent d496c03497
commit 5c91bc981c

View file

@ -1246,15 +1246,29 @@ apply_python_patch() {
} }
verify_python() { verify_python() {
local python="$1" local python="${1##python}"
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
# Only symlinks are installed in ${PREFIX_PATH}/bin # Only symlinks are installed in ${PREFIX_PATH}/bin
rm -fr "${PREFIX_PATH}/bin" rm -fr "${PREFIX_PATH}/bin"
ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/bin" "${PREFIX_PATH}/bin" ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/bin" "${PREFIX_PATH}/bin"
fi fi
if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then
( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" ) # Create symlinks
fi 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 if [ ! -x "${PYTHON_BIN}" ]; then
{ colorize 1 "ERROR" { colorize 1 "ERROR"
echo ": invalid Python executable: ${PYTHON_BIN}" echo ": invalid Python executable: ${PYTHON_BIN}"