make.sh: Show last lines of log when build aborts

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2017-05-05 14:10:36 +02:00
parent a0ab2f880e
commit 3f9ecfdc27

View File

@@ -310,6 +310,16 @@ exiterror() {
losetup -d /dev/loop${i} 2>/dev/null
fi;
done
if [ -n "${LOGFILE}" ]; then
echo # empty line
local line
while read -r line; do
echo " ${line}"
done <<< "$(tail -n30 ${LOGFILE})"
fi
echo -e "\nERROR: $*"
echo " Check $LOGFILE for errors if applicable"
exit 1