1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-15 11:46:41 +00:00

Update termux_step_massage.sh: changing how fix shebang paths works

This commit is contained in:
Ivan Max 2023-09-10 14:02:41 +03:00 committed by GitHub
parent 276ebf803d
commit d375d7c8e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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