From 9b2278c8b5c696263a5c525adbb7974e854bc520 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Nov 28 2017 10:33:31 +0000 Subject: subr/pkg_install_libs.subr:pkgp_install_lib_link(): prevent recursive link. --- diff --git a/subr/pkg_install_libs.subr b/subr/pkg_install_libs.subr index 61d87a5..c4b49c6 100644 --- a/subr/pkg_install_libs.subr +++ b/subr/pkg_install_libs.subr @@ -19,11 +19,12 @@ pkgp_install_lib_check() { pkgp_install_lib_link() { local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \ _lib_link_tgt _lib_link_path; + _lib_link_path="${_so_path%.so*}.lib.a"; _lib_link_tgt="$(find "${_so_dir}" \ -name "${_lib_name%%.*}.*.lib.a" |\ sort | tail -1)"; - if [ -n "${_lib_link_tgt}" ]; then - _lib_link_path="${_so_path%.so*}.lib.a"; + if [ -n "${_lib_link_tgt}" ]\ + && [ "${_lib_link_tgt}" != "${_lib_link_path}" ]; then ex_build_fileop rm "${_lib_link_path}"; ex_build_fileop ln_symbolic "$(ex_basename "${_lib_link_tgt}")" \ "${_lib_link_path}";