Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.
(cherry picked from commit 48c44fe6d4)
24 lines
561 B
Bash
Executable File
24 lines
561 B
Bash
Executable File
#!/bin/sh
|
|
|
|
ret=0
|
|
for spatch in cocci/*.spatch; do
|
|
patch="$(dirname "$spatch")/$(basename "$spatch" .spatch).patch"
|
|
: > "$patch"
|
|
echo "Applying semantic patch $spatch..."
|
|
spatch --jobs "${TEST_PARALLEL_JOBS:-1}" --sp-file "$spatch" --use-gitgrep --dir "." --very-quiet --include-headers "$@" >> "$patch" 2> cocci.stderr
|
|
cat cocci.stderr
|
|
if grep -q -e "parse error" cocci.stderr; then
|
|
ret=1
|
|
fi
|
|
if [ "$(< "$patch" wc -l)" -gt "0" ]; then
|
|
cat "$patch"
|
|
ret=1
|
|
else
|
|
rm "$patch"
|
|
fi
|
|
done
|
|
|
|
rm -f cocci.stderr
|
|
|
|
exit $ret
|