From 603b8188bb32fc7ef296615f2322467bca382a9a Mon Sep 17 00:00:00 2001 From: Danilo Cesar Lemes de Paula Date: Thu, 19 May 2016 11:27:36 -0300 Subject: [PATCH] scripts: make git-update.sh build with all cores available The git-update.sh now builds with all cores available. In case of failure it defaults to 1 The developer can still override this by setting -j to something else in MAKEFLAGS, as stated by 299605dfe2f97fca330161ff01a392e1a85fe422. https://bugzilla.gnome.org/show_bug.cgi?id=766666 --- scripts/git-update.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/git-update.sh b/scripts/git-update.sh index aaa738f..d02e0f7 100755 --- a/scripts/git-update.sh +++ b/scripts/git-update.sh @@ -29,6 +29,8 @@ tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$ ERROR_LOG="$tmp/failures.log" ERROR_RETURN=255 +CPUCORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo "1") + for m in $CORE $MODULES $EXTRA_MODULES; do if test -d $m; then echo "+ updating $m" @@ -91,7 +93,7 @@ build() fi echo "+ $1: make" - make > "$tmp/$1-make.log" 2>&1 + MAKEFLAGS="-j$CPUCORES $MAKEFLAGS" make > "$tmp/$1-make.log" 2>&1 if test $? -ne 0 then echo "$1: make [$tmp/$1-make.log]" >> $ERROR_LOG -- 2.7.4