termux_step_massage: Insert `head -n 1` in shebang fix

to avoid "binary file matches" message.
This commit is contained in:
Tee KOBAYASHI 2023-01-19 06:22:00 +09:00 committed by xtkoba
parent e9b1e0b2da
commit acec7e6460
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ termux_step_massage() {
if [ "$TERMUX_PKG_NO_SHEBANG_FIX" != "true" ]; then
# Fix shebang paths:
while IFS= read -r -d '' file; do
if head -c 100 "$file" | grep -E "^#!.*/bin/.*" | grep -q -E -v "^#! ?/system"; then
if head -c 100 "$file" | head -n 1 | grep -E "^#!.*/bin/.*" | grep -q -E -v "^#! ?/system"; then
sed --follow-symlinks -i -E "1 s@^#\!(.*)/bin/(.*)@#\!$TERMUX_PREFIX/bin/\2@" "$file"
fi
done < <(find -L . -type f -print0)