From 251484977c01f9fdad5e26debcfc6d8901db921b Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sun, 11 Aug 2019 03:23:57 +0300 Subject: [PATCH] build-package.sh: fix error in termux_step_massage() when bin, lib, libexec are not exist Fixes https://github.com/termux/termux-packages/issues/4160. --- scripts/build/termux_step_massage.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build/termux_step_massage.sh b/scripts/build/termux_step_massage.sh index 4358f94f9..da8abd8b9 100644 --- a/scripts/build/termux_step_massage.sh +++ b/scripts/build/termux_step_massage.sh @@ -19,13 +19,14 @@ termux_step_massage() { if [ "$TERMUX_DEBUG" = "" ]; then # Strip binaries. file(1) may fail for certain unusual files, so disable pipefail. set +e +o pipefail - find bin lib libexec -type f | xargs -r file | grep -E "ELF .+ (executable|shared object)" | cut -f 1 -d : | \ - xargs -r "$STRIP" --strip-unneeded --preserve-dates + find \( -path "./bin/*" -o -path "./lib/*" -o -path "./libexec/*" \) -type f | \ + xargs -r file | grep -E "ELF .+ (executable|shared object)" | cut -f 1 -d : | \ + xargs -r "$STRIP" --strip-unneeded --preserve-dates set -e -o pipefail fi # Remove entries unsupported by Android's linker: - find bin lib libexec -type f -print0 | xargs -r -0 "$TERMUX_ELF_CLEANER" + find \( -path "./bin/*" -o -path "./lib/*" -o -path "./libexec/*" \) -type f -print0 | xargs -r -0 "$TERMUX_ELF_CLEANER" # Fix shebang paths: while IFS= read -r -d '' file