From cbd246acfff0439f54dde89548cc997e37b75a11 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 31 Jan 2015 16:13:26 +0900 Subject: [PATCH] Symlink `pythonX.Y-config` to `python-config` if `python-config` is missing (fixes #296) --- plugins/python-build/bin/python-build | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 3e6afff9..227e88d5 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1338,13 +1338,21 @@ verify_python() { # Not create symlinks on `altinstall` (#255) if [[ "$PYTHON_MAKE_INSTALL_TARGET" != *"altinstall"* ]]; then local suffix="${1#python}" - local file + local file link shopt -s nullglob for file in "${PREFIX_PATH}/bin"/*; do - local link + unset link case "${file}" in - *"-${suffix}" ) link="${file%%-${suffix}}" ;; - *"${suffix}" ) link="${file%%${suffix}}" ;; + */"python${suffix}-config" ) + # Symlink `pythonX.Y-config` to `python-config` if `python-config` is missing (#296) + link="${file%/*}/python-config" + ;; + */*"-${suffix}" ) + link="${file%%-${suffix}}" + ;; + */*"${suffix}" ) + link="${file%%${suffix}}" + ;; esac if [ -n "$link" ] && [ ! -e "$link" ]; then ( cd "${file%/*}" && ln -fs "${file##*/}" "${link##*/}" )