Make brp-strip-comment-note multi process

Run at least the file classification in parallel

Resolves: #1230
This commit is contained in:
Florian Festi 2021-09-15 14:54:40 +02:00 committed by Panu Matilainen
parent 74ddf22d2e
commit 16ccdb704b
1 changed files with 2 additions and 3 deletions

View File

@ -6,6 +6,7 @@ fi
STRIP=${1:-strip}
OBJDUMP=${2:-objdump}
NCPUS=${RPM_BUILD_NCPUS:-1}
case `uname -a` in
Darwin*) exit 0 ;;
@ -14,9 +15,7 @@ esac
# Strip .comment and .note sections (the latter only if it is not allocated)
# for already stripped elf files in the build root
for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'`; do
for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -print0 | xargs -0 -r -P$NCPUS -n32 sh -c "file \"\\$@\" | grep -v \"^${RPM_BUILD_ROOT}/\?usr/lib/debug\" | sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'" ARG0`; do
note="-R .note"
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
grep ALLOC >/dev/null; then