Commit 47ed9cda authored by gsell's avatar gsell

bugfix: handle empty list of be installed shared libs

parent a01b60bc
...@@ -593,21 +593,21 @@ pbuild::install() { ...@@ -593,21 +593,21 @@ pbuild::install() {
} }
pbuild::install_shared_libs() { pbuild::install_shared_libs() {
local -r binary="${PREFIX}/$1" local -r binary="$1"
local -r pattern="${2//\//\\/}" # escape slash local -r dstdir="$2"
local -r dstdir="${3:-${PREFIX}/lib}" local -r pattern="${3//\//\\/}" # escape slash
install_shared_libs_Linux() { install_shared_libs_Linux() {
local libs=( $(ldd "${binary}" | \ local libs=( $(ldd "${binary}" | \
awk "/ => \// && /${pattern}/ {print \$3}") ) awk "/ => \// && /${pattern}/ {print \$3}") )
cp -avL "${libs[@]}" "${dstdir}" [[ -n "${libs}" ]] && cp -vL "${libs[@]}" "${dstdir}"
} }
install_shared_libs_Darwin() { install_shared_libs_Darwin() {
# https://stackoverflow.com/questions/33991581/install-name-tool-to-update-a-executable-to-search-for-dylib-in-mac-os-x # https://stackoverflow.com/questions/33991581/install-name-tool-to-update-a-executable-to-search-for-dylib-in-mac-os-x
local libs=( $(otool -L "${binary}" | \ local libs=( $(otool -L "${binary}" | \
awk "/${pattern}/ {print \$1}")) awk "/${pattern}/ {print \$1}"))
cp -avL "${libs[@]}" "${dstdir}" [[ -n "${libs}" ]] && cp -vL "${libs[@]}" "${dstdir}"
} }
test -e "${binary}" || \ test -e "${binary}" || \
...@@ -1268,7 +1268,7 @@ pbuild.build_module() { ...@@ -1268,7 +1268,7 @@ pbuild.build_module() {
"since the dependency '$m' is ${release_of_dependency}" "since the dependency '$m' is ${release_of_dependency}"
fi fi
echo "Loading module: ${m}" std::info "Loading module: ${m}\n"
module load "${m}" module load "${m}"
done done
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment