richardphibel / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
ed184b
From f23af97c4135013d3134a17c881014fb6e9589c8 Mon Sep 17 00:00:00 2001
ed184b
From: Florian Festi <ffesti@redhat.com>
ed184b
Date: Tue, 30 Apr 2019 17:12:35 +0200
ed184b
Subject: [PATCH] Make check-buildroot check the build files in parallel
ed184b
ed184b
Thanks to Denys Vlasenko for pointing this out in rhbz#1704353
ed184b
---
ed184b
 scripts/check-buildroot | 3 ++-
ed184b
 1 file changed, 2 insertions(+), 1 deletion(-)
ed184b
ed184b
diff --git a/scripts/check-buildroot b/scripts/check-buildroot
ed184b
index 0cfb34f39..f91dc767b 100755
ed184b
--- a/scripts/check-buildroot
ed184b
+++ b/scripts/check-buildroot
ed184b
@@ -24,11 +24,12 @@ fi
ed184b
 
ed184b
 tmp=$(mktemp ${TMPDIR:-/tmp}/cbr.XXXXXX)
ed184b
 trap "rm -f $tmp" EXIT
ed184b
+NCPUS=${RPM_BUILD_NCPUS:-1}
ed184b
 
ed184b
 find "$RPM_BUILD_ROOT" \! \( \
ed184b
     -name '*.pyo' -o -name '*.pyc' -o -name '*.elc' -o -name '.packlist' \
ed184b
     \) -type f -print0 | \
ed184b
-    LANG=C xargs -0r grep -F "$RPM_BUILD_ROOT" >$tmp
ed184b
+    LANG=C xargs -0r -P$NCPUS -n16 grep -F "$RPM_BUILD_ROOT" >>$tmp
ed184b
 
ed184b
 test -s "$tmp" && {
ed184b
     cat "$tmp"
ed184b
-- 
ed184b
2.21.0
ed184b