chantra / rpms / rpm

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