From 3bfb8b45b9305e13acfdb82586c3075e96c2c362 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sat, 11 May 2019 06:42:31 +0200 Subject: [PATCH] termux_step_install_license: Handle spaces in license name --- scripts/build/termux_step_install_license.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/termux_step_install_license.sh b/scripts/build/termux_step_install_license.sh index 995dd22c7..864350f0a 100644 --- a/scripts/build/termux_step_install_license.sh +++ b/scripts/build/termux_step_install_license.sh @@ -3,11 +3,11 @@ termux_step_install_license() { if [ ! "${TERMUX_PKG_LICENSE_FILE}" = "" ]; then for LICENSE in $TERMUX_PKG_LICENSE_FILE; do if [ ! -f "$TERMUX_PKG_SRCDIR/$LICENSE" ]; then termux_error_exit "$TERMUX_PKG_SRCDIR/$LICENSE does not exist"; fi - cp ${TERMUX_PKG_SRCDIR}/${LICENSE} ${TERMUX_PREFIX}/share/${TERMUX_PKG_NAME} + cp -f ${TERMUX_PKG_SRCDIR}/${LICENSE} ${TERMUX_PREFIX}/share/${TERMUX_PKG_NAME} done else local COUNTER=0 - for LICENSE in $(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g'); do + for LICENSE in "$(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g')"; do if [ -f "$TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt" ]; then if [[ $COUNTER > 0 ]]; then ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE.${COUNTER}" @@ -17,7 +17,7 @@ termux_step_install_license() { fi COUNTER=$((COUNTER + 1)) done - if [ ! -f "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE*" ]; then + if [ ! -f $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE* ] && [ ! -L $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE* ]; then termux_error_exit "No LICENSE file was installed for $TERMUX_PKG_NAME" fi fi