diff --git a/scripts/brp-strip b/scripts/brp-strip index e7388780b8..76b360b8f8 100755 --- a/scripts/brp-strip +++ b/scripts/brp-strip @@ -32,8 +32,9 @@ strip_elf_binaries() local nlinks="${1}" local nprocs="${2}" - find "$RPM_BUILD_ROOT" -type f \ - ! -regex "${RPM_BUILD_ROOT}/*usr/lib/debug.*" \ + cd "$RPM_BUILD_ROOT" || return 0 + find . -type f \ + ! -regex '\./usr/lib/debug.*' \ ! -name "*.py" ! -name "*.js" ! -name "*.rb" \ ! -name "*.go" -links "${nlinks}" -print0 | \ xargs -0 -r -P${nprocs} -n${MAX_ARGS} sh -c "file \"\$@\" | \ diff --git a/scripts/brp-strip-static-archive b/scripts/brp-strip-static-archive index c10e247ec1..be869fa221 100755 --- a/scripts/brp-strip-static-archive +++ b/scripts/brp-strip-static-archive @@ -13,5 +13,6 @@ Darwin*) exit 0 ;; esac # Strip static libraries. -find "$RPM_BUILD_ROOT" -type f \! -regex "${RPM_BUILD_ROOT}/*usr/lib/debug.*" -print0 | \ +cd "$RPM_BUILD_ROOT" || exit 0 +find . -type f \! -regex '\./usr/lib/debug.*' -print0 | \ xargs -0 -r -P$NCPUS -n32 sh -c "file \"\$@\" | sed 's/: */: /' | grep 'current ar archive' | sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p' | xargs -d '\n' -I\{\} $STRIP -g \{\}" ARG0