Exit with non-zero status when spatch on a directory fails
When an error occurs during patching of a file, the process terminates with a 255 exit code.
spatch docs/dev/file-path-error.cocci docs/dev/test1.c
This was not the case when trying to apply the patch on a directory:
spatch docs/dev/file-path-error.cocci docs/dev/
The process would print errors for each file individually, and then finish with a zero (success) exit code. Additionally, it would write out files for files that succeeded.
Let’s exit with 255 when failure occurs during the mass patching as well, and prevent writing the changes of successful transformations to avoid the chance of accidentally not noticing the failure.
Let’s also introduce a --keep-going
flag that reverts to the previous
behaviour. And also do the same with --bench
and --compare-with-expected
since the testing infrastructure relies on it.
Signed-off-by: Jan Tojnar jtojnar@gmail.com