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 299605dfe2.

https://bugzilla.gnome.org/show_bug.cgi?id=766666
This commit is contained in:
Danilo Cesar Lemes de Paula 2016-05-19 11:27:36 -03:00 committed by Tim-Philipp Müller
parent 56ee365077
commit 603b8188bb

View file

@ -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