From 2233e1134301c9164b80880220d79d77c067a307 Mon Sep 17 00:00:00 2001 From: Mohammad Farzan Date: Mon, 29 Aug 2022 11:00:53 +0430 Subject: [PATCH] Fix free translation error Ported from: m2-farzan/ros2-galactic-PKGBUILD#33 --- PKGBUILD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 6b3a384..1e8fd63 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -61,7 +61,8 @@ prepare() { build() { # Disable parallel build if RAM is low - if [[ $(free | grep -Po "Mem:\s+\K\d+") -lt 16000000 ]]; then + MIN_PARALLEL_BUILD_RAM_KB=16000000 + if [[ $(free | grep -Po "Mem:\s+\K\d+") -lt $MIN_PARALLEL_BUILD_RAM_KB && $(grep MemTotal /proc/meminfo | grep -Po "MemTotal:\s+\K\d+") -lt $MIN_PARALLEL_BUILD_RAM_KB ]]; then printf "\nRAM is smaller than 16 GB. Parallel build will be disabled for stability.\n\n" export COLCON_EXTRA_ARGS="${COLCON_EXTRA_ARGS} --executor sequential" fi