summaryrefslogtreecommitdiffstats
path: root/run-make-check.sh
diff options
context:
space:
mode:
authorLoic Dachary <ldachary@redhat.com>2015-01-29 14:18:18 +0100
committerLoic Dachary <ldachary@redhat.com>2015-01-29 14:18:18 +0100
commite45e97be6769149077d94a12b6bb4c8f8a882289 (patch)
treed9b7e4cdd5634f7af4178dad00d587287c563626 /run-make-check.sh
parentMerge pull request #3514 from rzarzynski/wip-10550 (diff)
downloadceph-e45e97be6769149077d94a12b6bb4c8f8a882289.tar.xz
ceph-e45e97be6769149077d94a12b6bb4c8f8a882289.zip
run-make-check: use nproc and shorter git expression
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Diffstat (limited to 'run-make-check.sh')
-rwxr-xr-xrun-make-check.sh10
1 files changed, 4 insertions, 6 deletions
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