From bc7bbfa08475f3ef43e5caf366a5c7730d6749da Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 6 Apr 2022 15:26:59 +0200 Subject: mbuto: Add IFS-setting wrapper for libs_copy() This avoids the need to set IFS and reset it around libs_copy() calls. Signed-off-by: Stefano Brivio --- mbuto | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mbuto b/mbuto index 4f27242..6d447bc 100755 --- a/mbuto +++ b/mbuto @@ -548,9 +548,9 @@ libs_dlopen_copy() { done } -# libs_copy() - Recursively copy shared dependencies for programs and libraries +# __libs_copy() - Recursively copy shared dependencies for programs, libraries # $1: Host path to program or library -libs_copy() { +__libs_copy() { info "Sourcing shared object dependencies for ${1}" # ldd might succeed and print errors on stdout when paths are not found. @@ -591,6 +591,15 @@ libs_copy() { fi } +# libs_copy() - Call __libs_copy with tabs and newlines as IFS +# $@: Arguments to __libs_copy +libs_copy() { + IFS=' +' + __libs_copy "${@}" + unset IFS +} + ################################################################################ @@ -639,10 +648,7 @@ prog_add() { "${__target}" "${__l}" done - IFS=' -' libs_copy "${__bin}" - unset IFS } ################################################################################ @@ -762,10 +768,7 @@ pkg_deb_add() { __type="$("${FILE}" -bi "${wd}/${__f}")" if [ "${__type%%;*}" = "application/x-sharedlib" ] || [ "${__type%%;*}" = "application/x-executable" ]; then - IFS=' -' libs_copy "${wd}/${__f}" - unset IFS fi done } @@ -783,10 +786,7 @@ pkg_rpm_add() { __type="$("${FILE}" -bi "${wd}/${__f}")" if [ "${__type%%;*}" = "application/x-sharedlib" ] || [ "${__type%%;*}" = "application/x-executable" ]; then - IFS=' -' libs_copy "${wd}/${__f}" - unset IFS fi done } -- cgit v1.2.3