From: Jo-Philipp Wich Date: Wed, 29 Aug 2018 11:16:34 +0000 (+0200) Subject: scripts: bundle-libraries: fix logic flaw X-Git-Tag: v17.01.6~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9d3825a0279a9c70fb16179731f212abf961693e;p=oweals%2Fopenwrt.git scripts: bundle-libraries: fix logic flaw Previous refactoring of the script moved the LDSO detection into a file-not-exists condition, causing onyl the very first executable to get bundled. Solve the problem by unconditionally checking for LDSO again. Fixes: 9030a78a71 ("scripts: bundle-libraries: prevent loading host locales") Signed-off-by: Jo-Philipp Wich (cherry picked from commit 5ebcd32997b6d10abcd29c8795a598fdcaf4521d) --- diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh index 4662b98dee..d3c7206a4d 100755 --- a/scripts/bundle-libraries.sh +++ b/scripts/bundle-libraries.sh @@ -156,17 +156,16 @@ for BIN in "$@"; do dest="$DIR/lib/${token##*/}" ddir="${dest%/*}" + case "$token" in + */ld-*.so*) LDSO="${token##*/}" ;; + esac + [ -f "$token" -a ! -f "$dest" ] && { _md "$ddir" _cp "$token" "$dest" case "$token" in - *ld-*.so*) - LDSO="${token##*/}" - _patch_ldso "$dest" - ;; - libc.so.6|*/libc.so.6) - _patch_glibc "$dest" - ;; + */ld-*.so*) _patch_ldso "$dest" ;; + */libc.so.6) _patch_glibc "$dest" ;; esac } ;; esac