]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build: make-debs.sh NPROC overrides make -j
authorLoic Dachary <ldachary@redhat.com>
Sat, 2 May 2015 14:11:51 +0000 (16:11 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 5 May 2015 17:16:56 +0000 (19:16 +0200)
Building a package is disk intensive and running make -j8 on a machine
with a spinner can actually be slower than make. NPROC=1 make-deb.sh
overrides the default value of make -jX.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
make-debs.sh

index 535b27b929bffb3e675134c3ecc796d5418bea65..b8d3e46489cd2c2e05e9d8ec8c810b0462efef69 100755 (executable)
@@ -80,7 +80,11 @@ fi
 # b) do not sign the packages
 # c) use half of the available processors
 #
-PATH=/usr/lib/ccache:$PATH dpkg-buildpackage -j$(($(nproc) / 2)) -uc -us
+: ${NPROC:=$(($(nproc) / 2))}
+if test $NPROC -gt 1 ; then
+    j=-j${NPROC}
+fi
+PATH=/usr/lib/ccache:$PATH dpkg-buildpackage $j -uc -us
 cd ../..
 mkdir -p $codename/conf
 cat > $codename/conf/distributions <<EOF