From baa928b247bff1b8ef4e3b32781500b7b8e76489 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 4 Jun 2019 12:09:53 +0200 Subject: [PATCH] travis/build.sh: use -jX in xbps-src. Do not rely on nproc(1) being available. Signed-off-by: Juan RP --- common/travis/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/travis/build.sh b/common/travis/build.sh index 32cefdbc739..bd65283d10a 100755 --- a/common/travis/build.sh +++ b/common/travis/build.sh @@ -25,8 +25,13 @@ XBPS_SRCPKGDIR=/hostrepo/srcpkgs XBPS_MASTERDIR=/ chroot_prepare $1 || { PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates)) +NPROCS=1 +if [ -r /proc/cpuinfo ]; then + NPROCS=$(grep ^proc /proc/cpuinfo|wc -l) +fi + for pkg in ${PKGS}; do - /hostrepo/xbps-src -H "$HOME"/hostdir $arch pkg "$pkg" + /hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg" [ $? -eq 1 ] && exit 1 done