termux_step_install_license: error if no LICENSE file is installed

This commit is contained in:
Henrik Grimler 2019-05-05 20:21:16 +02:00 committed by Leonid Pliushch
parent 83177e08e3
commit b9db6b4de8
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,6 @@ termux_step_install_license() {
else
local COUNTER=0
for LICENSE in $(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g'); do
echo "checking for $TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt"
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}"
@ -18,5 +17,8 @@ termux_step_install_license() {
fi
COUNTER=$((COUNTER + 1))
done
if [ ! -f "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE*" ]; then
termux_error_exit "No LICENSE file was installed for $TERMUX_PKG_NAME"
fi
fi
}