Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

livepatch/klp-build: add grep-override function

Provide a custom grep() function to catch direct usage of the command.
Bare grep calls are generally incompatible with pipefail and
errexit behavior (where a failed match causes the script to exit).

Developers can still call grep via command grep if that behavior is
explicitly desired.

Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Link: https://patch.msgid.link/20260310203751.1479229-6-joe.lawrence@redhat.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

authored by

Joe Lawrence and committed by
Josh Poimboeuf
e4dbf706 d36a7343

+7
+7
scripts/livepatch/klp-build
··· 56 56 command grep "$@" || true 57 57 } 58 58 59 + # Because pipefail is enabled, the grep0 helper should be used instead of 60 + # grep, otherwise a failed match can propagate to an error. 61 + grep() { 62 + echo "error: $SCRIPT: use grep0 or 'command grep' instead of bare grep" >&2 63 + exit 1 64 + } 65 + 59 66 status() { 60 67 echo "$*" 61 68 }