Skip to content

Commit

Permalink
Fix check-buildroot missing matches with grep >= 3.5
Browse files Browse the repository at this point in the history
Since 3.5, grep emits the diagnostic "binary file matches" message
to stderr which causes the result file to be empty and build continuing
despite an obvious error being present.

We're not interested in the match itself, only whether there are files
with matches. Grep has a standard option for this (-l), use it.

Fixes: #1968
  • Loading branch information
pmatilai committed Apr 4, 2022
1 parent 7f21b84 commit 96de5c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/check-buildroot
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NCPUS=${RPM_BUILD_NCPUS:-1}
find "$RPM_BUILD_ROOT" \! \( \
-name '*.pyo' -o -name '*.pyc' -o -name '*.elc' -o -name '.packlist' \
\) -type f -print0 | \
LANG=C xargs -0r -P$NCPUS -n16 grep -F "$RPM_BUILD_ROOT" >>$tmp
LANG=C xargs -0r -P$NCPUS -n16 grep -lF "$RPM_BUILD_ROOT" >>$tmp

test -s "$tmp" && {
cat "$tmp"
Expand Down

0 comments on commit 96de5c1

Please sign in to comment.