http://tracker.ceph.com/issues/13845 Refs: #13845
Signed-off-by: Loic Dachary <loic@dachary.org>
rm -fr $d
}
+function maybe_parallel() {
+ local nproc=$1
+ local vers=$2
+
+ if echo $vers | grep --quiet '0\.67' ; then
+ return
+ fi
+
+ if test $nproc -gt 1 ; then
+ echo -j${nproc}
+ fi
+}
+
+function test_maybe_parallel() {
+ test "$(maybe_parallel 1 0.72)" = "" || return 1
+ test "$(maybe_parallel 8 0.67)" = "" || return 1
+ test "$(maybe_parallel 8 0.72)" = "-j8" || return 1
+}
+
if test "$1" = "TEST" ; then
shopt -s -o xtrace
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
test_link_same
+ test_maybe_parallel
fi
DEBEMAIL="contact@ceph.com" dch -D $codename --force-distribution -b -v "$dvers" "new version"
fi
#
- # create the packages
- # a) with ccache to speed things up when building repeatedly
- # b) do not sign the packages
- # c) use half of the available processors
+ # create the packages (with ccache)
#
- if test $NPROC -gt 1 ; then
- j=-j${NPROC}
- fi
+ j=$(maybe_parallel $NPROC $vers)
PATH=/usr/lib/ccache:$PATH dpkg-buildpackage $j -uc -us
}
# d) contains the short hash of the commit
#
vers=$(git describe --long --match "v*" | sed s/^v//)
-: ${NPROC:=$(nproc)}
ceph_dir=$(pwd)
#