From: Loic Dachary Date: Thu, 29 Jan 2015 13:18:18 +0000 (+0100) Subject: run-make-check: use nproc and shorter git expression X-Git-Tag: v0.93~97^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e45e97be6769149077d94a12b6bb4c8f8a882289;p=ceph.git run-make-check: use nproc and shorter git expression Signed-off-by: Loic Dachary --- diff --git a/run-make-check.sh b/run-make-check.sh index f31b2c0929a..df88f1a0087 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -13,12 +13,11 @@ # # -# Return true if the working tree is after the commit that made +# Return true if the working tree is after the release that made # make -j8 check possible # function can_parallel_make_check() { - local commit=$(git rev-parse tags/v0.88^{}) - git rev-list HEAD | grep --quiet $commit + test "$(git rev-list --max-count=1 --ancestry-path HEAD ^tags/v0.88)" } function maybe_parallel_make_check() { @@ -33,9 +32,8 @@ function get_processors() { if test -n "$NPROC" ; then echo $NPROC else - local processors=$(grep -c '^processor' /proc/cpuinfo) - if test $processors -ge 2 ; then - expr $processors / 2 + if test $(nproc) -ge 2 ; then + expr $(nproc) / 2 else echo 1 fi