termux-tools: Avoid breaking symlinks with termux-fix-shebang

This commit is contained in:
Fredrik Fornwall 2015-09-08 18:36:35 -04:00
parent 37128d280e
commit c491280161
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=http://termux.com/
TERMUX_PKG_DESCRIPTION="Some tools for Termux"
TERMUX_PKG_VERSION=0.10
TERMUX_PKG_VERSION=0.11
termux_step_make_install () {
$CXX $CFLAGS $LDFLAGS -std=c++14 -Wall -Wextra -pedantic -Werror $TERMUX_PKG_BUILDER_DIR/*.cpp -o $TERMUX_PREFIX/bin/termux-elf-cleaner

View File

@ -7,4 +7,7 @@ if [ $# = 0 -o "$1" = "-h" ]; then
exit 1
fi
sed -i -E "s@^#\!(.*)/bin/(.*)@#\!@TERMUX_PREFIX@/bin/\2@" $@
for file in $@; do
# Do realpath to avoid breaking symlinks (modify original file):
sed -i -E "s@^#\!(.*)/bin/(.*)@#\!/data/data/com.termux/files/usr/bin/\2@" `realpath $@`
done