devel/upload: Build in parallel
authorMichael Hanselmann <hansmi@google.com>
Mon, 31 Aug 2009 09:37:26 +0000 (11:37 +0200)
committerMichael Hanselmann <hansmi@google.com>
Mon, 31 Aug 2009 09:57:46 +0000 (11:57 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

devel/upload.in

index 733befa..0ba650b 100644 (file)
@@ -63,8 +63,15 @@ set ${hosts}
 TXD=`mktemp -d`
 trap 'rm -rf $TXD' EXIT
 
+if [[ -f /proc/cpuinfo ]]; then
+  cpu_count=$(grep -E -c '^processor\s*:' /proc/cpuinfo)
+  make_args=-j$(( cpu_count + 1 ))
+else
+  make_args=
+fi
+
 # install ganeti as a real tree
-make install DESTDIR="$TXD"
+make $make_args install DESTDIR="$TXD"
 
 # copy additional needed files
 install -D --mode=0755 doc/examples/ganeti.initd \