# HG changeset patch # User Paper # Date 1708290134 18000 # Node ID 699a20c57dc819e4cb37cfbbd81a7298ae65dc4d # Parent 6f3d193cb4b7d287a190ca982da0a71a800eda2b scripts: Bourne shell compatibility diff -r 6f3d193cb4b7 -r 699a20c57dc8 scripts/win32/deploy_build.sh --- a/scripts/win32/deploy_build.sh Wed Feb 07 17:06:31 2024 -0500 +++ b/scripts/win32/deploy_build.sh Sun Feb 18 16:02:14 2024 -0500 @@ -10,11 +10,16 @@ GetNeededLibraries() { # do not run this on untrusted executables. # see: ldd(1) + system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")" ldd "$1" | while IFS="" read -r dependency; do - lib="$(cut -d' ' -f3 <<< $dependency)" - if [[ "$lib" == /"${MSYSTEM,,}"/* ]]; then - echo "$lib" - fi + lib="$(printf -- "$dependency" | cut -d' ' -f3)" + case $lib in + "/$system/"*) + printf -- "$lib\n" + ;; + *) + ;; + esac done }