From 6b56911d9c8c03609525ef63eea99882f6b6edb0 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 1 Feb 2017 22:45:14 +0100 Subject: [PATCH] build-package.sh: Handle weird file names better --- build-package.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-package.sh b/build-package.sh index 3b82b8544..e05f4fe3f 100755 --- a/build-package.sh +++ b/build-package.sh @@ -808,9 +808,10 @@ termux_step_massage() { find . -type f -print0 | xargs -r -0 "$TERMUX_ELF_CLEANER" # Fix shebang paths: - for file in `find -L . -type f`; do - head -c 100 $file | grep -E "^#\!.*\\/bin\\/.*" | grep -q -E -v "^#\! ?\\/system" && sed --follow-symlinks -i -E "1 s@^#\!(.*)/bin/(.*)@#\!$TERMUX_PREFIX/bin/\2@" $file - done + while IFS= read -r -d '' file + do + head -c 100 "$file" | grep -E "^#\!.*\\/bin\\/.*" | grep -q -E -v "^#\! ?\\/system" && sed --follow-symlinks -i -E "1 s@^#\!(.*)/bin/(.*)@#\!$TERMUX_PREFIX/bin/\2@" "$file" + done < <(find -L . -type f -print0) test ! -z "$TERMUX_PKG_RM_AFTER_INSTALL" && rm -Rf $TERMUX_PKG_RM_AFTER_INSTALL @@ -823,7 +824,7 @@ termux_step_massage() { echo TERMUX_SUBPKG_INCLUDE=\"include share/man/man3 lib/pkgconfig share/aclocal lib/cmake $TERMUX_PKG_INCLUDE_IN_DEVPACKAGE\" > "$_DEVEL_SUBPACKAGE_FILE" echo "TERMUX_SUBPKG_DESCRIPTION=\"Development files for ${TERMUX_PKG_NAME}\"" >> "$_DEVEL_SUBPACKAGE_FILE" if [ -n "$TERMUX_PKG_DEVPACKAGE_DEPENDS" ]; then - echo "TERMUX_SUBPKG_DEPENDS=\"$TERMUX_PKG_NAME,$TERMUX_PKG_DEVPACKAGE_DEPENDS\"" >> $_DEVEL_SUBPACKAGE_FILE + echo "TERMUX_SUBPKG_DEPENDS=\"$TERMUX_PKG_NAME,$TERMUX_PKG_DEVPACKAGE_DEPENDS\"" >> "$_DEVEL_SUBPACKAGE_FILE" else echo "TERMUX_SUBPKG_DEPENDS=\"$TERMUX_PKG_NAME\"" >> "$_DEVEL_SUBPACKAGE_FILE" fi