]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
run-make-check: use nproc and shorter git expression 3532/head
authorLoic Dachary <ldachary@redhat.com>
Thu, 29 Jan 2015 13:18:18 +0000 (14:18 +0100)
committerLoic Dachary <ldachary@redhat.com>
Thu, 29 Jan 2015 13:18:18 +0000 (14:18 +0100)
Signed-off-by: Loic Dachary <ldachary@redhat.com>
run-make-check.sh

index f31b2c0929a9f53b258257687614673acd62651d..df88f1a00872a76178e04a190a072c5f1014fb6e 100755 (executable)
 #
 
 #
-# 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