From: Michael Tremer Date: Mon, 21 May 2018 19:56:58 +0000 (+0100) Subject: make.sh: Use exiterror to end script safely X-Git-Tag: v2.21-core122~138 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=5852ad2db76bd25107280d6b0b04f4eee797bd9b make.sh: Use exiterror to end script safely Signed-off-by: Michael Tremer --- diff --git a/make.sh b/make.sh index 5d71bab789..62708abd66 100755 --- a/make.sh +++ b/make.sh @@ -862,16 +862,13 @@ fi HOST_MEM=$(system_memory) # Checking host memory, tuning XZ_OPT -if [ $HOST_MEM -lt 1024 ]; then - print_build_stage "Host-Memory: $HOST_MEM MiB" - print_build_stage "Not enough host memory (less than 1024 MiB, please consider upgrading)" - - exit 1 -else - XZ_MEM="$(( HOST_MEM * 7 / 10 ))MiB" - XZ_OPT="-T4 -8 --memory=$XZ_MEM" +if [ ${HOST_MEM} -lt 1024 ]; then + exiterror "You will need more than 1GB or host memory to run the build" fi +XZ_MEM="$(( HOST_MEM * 7 / 10 ))MiB" +XZ_OPT="-T4 -8 --memory=$XZ_MEM" + if [ -n "${BUILD_ARCH}" ]; then configure_build "${BUILD_ARCH}" else