hooks/11-pkglint-elf-in-usrshare: make use of bashisms to fix stuff.

using for-loop causes the loop to hang at filenames with -.

Use while read instead with bash process substitution so it avoids the
subshell problem.
This commit is contained in:
maxice8 2019-01-10 00:40:54 -02:00 committed by maxice8
parent 150c0a4872
commit 75e535d257
1 changed files with 3 additions and 2 deletions

View File

@ -11,12 +11,13 @@ hook() {
fi
# Find all binaries in /usr/share and add them to the pool
for f in $(find $PKGDESTDIR/usr/share -type f); do
while read -r f; do
case "$(file -bi "$f")" in
# Note application/x-executable is missing which is present in most Electron apps
application/x-sharedlib*|application/x-pie-executable*)
matches+=" ${f#$PKGDESTDIR}" ;;
esac
done
done < <(find $PKGDESTDIR/usr/share -type f)
if [ -z "$matches" ]; then
return 0