chiark / gitweb /
termux-tools: Quote $@ when sending from wrappers
authorFredrik Fornwall <fredrik@fornwall.net>
Tue, 19 Apr 2016 14:28:08 +0000 (10:28 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Tue, 19 Apr 2016 14:28:08 +0000 (10:28 -0400)
Fixes https://github.com/termux/termux-api/issues/18

build-package.sh
packages/termux-elf-cleaner/build.sh [new file with mode: 0644]
packages/termux-elf-cleaner/termux-elf-cleaner.cpp [moved from packages/termux-tools/termux-elf-cleaner.cpp with 100% similarity]
packages/termux-tools/build.sh

index 4348390697697aff293f242ab3e6b66fc6c23b2b..bd66cd7fd3f2240525f8d2e7167fa6e06e96eae2 100755 (executable)
@@ -273,7 +273,7 @@ HERE
 fi
 
 TERMUX_ELF_CLEANER=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner
 fi
 
 TERMUX_ELF_CLEANER=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner
-TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-tools/termux-elf-cleaner.cpp
+TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/termux-elf-cleaner.cpp
 if [ $TERMUX_ELF_CLEANER_SRC -nt $TERMUX_ELF_CLEANER ]; then
        g++ -std=c++11 -Wall -Wextra -pedantic -Os $TERMUX_ELF_CLEANER_SRC -o $TERMUX_ELF_CLEANER
 fi
 if [ $TERMUX_ELF_CLEANER_SRC -nt $TERMUX_ELF_CLEANER ]; then
        g++ -std=c++11 -Wall -Wextra -pedantic -Os $TERMUX_ELF_CLEANER_SRC -o $TERMUX_ELF_CLEANER
 fi
diff --git a/packages/termux-elf-cleaner/build.sh b/packages/termux-elf-cleaner/build.sh
new file mode 100644 (file)
index 0000000..f97fb0c
--- /dev/null
@@ -0,0 +1,7 @@
+TERMUX_PKG_HOMEPAGE=https://termux.com/
+TERMUX_PKG_DESCRIPTION="Cleaner of ELF files for Android"
+TERMUX_PKG_VERSION=1.0
+
+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
+}
index 05096dd2249d47216ae37bc3b6fe31b09d7cacea..47144ebacb016f806292246d50a2a0efc57eb96f 100644 (file)
@@ -1,10 +1,9 @@
-TERMUX_PKG_HOMEPAGE=http://termux.com/
-TERMUX_PKG_DESCRIPTION="Some tools for Termux"
-TERMUX_PKG_VERSION=0.26
+TERMUX_PKG_HOMEPAGE=https://termux.com/
+TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
+TERMUX_PKG_VERSION=0.27
+TERMUX_PKG_PLATFORM_INDEPENDENT=yes
 
 termux_step_make_install () {
 
 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
-
        # Remove LD_LIBRARY_PATH from environment to avoid conflicting
        # with system libraries that am may link against.
        for tool in am dalvikvm df getprop logcat ping ping6 ip pm settings; do
        # Remove LD_LIBRARY_PATH from environment to avoid conflicting
        # with system libraries that am may link against.
        for tool in am dalvikvm df getprop logcat ping ping6 ip pm settings; do
@@ -19,7 +18,7 @@ termux_step_make_install () {
                # at least am&pm on a Nexus 6p running Android 6.0:
                echo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE
 
                # at least am&pm on a Nexus 6p running Android 6.0:
                echo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE
 
-               echo "exec /system/bin/$tool \$@" >> $WRAPPER_FILE
+               echo "exec /system/bin/$tool \"\$@\"" >> $WRAPPER_FILE
                chmod +x $TERMUX_PREFIX/bin/$tool
        done
 
                chmod +x $TERMUX_PREFIX/bin/$tool
        done