2017-11-29 19:49:05 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2018-04-20 15:07:42 +02:00
|
|
|
files="$(git ls-files ':/*.[ch]')"
|
2018-04-20 15:21:06 +02:00
|
|
|
args=
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
-i)
|
|
|
|
args="$args --in-place"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
2018-04-20 15:07:42 +02:00
|
|
|
|
|
|
|
for SCRIPT in ${@-coccinelle/*.cocci} ; do
|
2018-03-23 15:44:10 +01:00
|
|
|
echo "--x-- Processing $SCRIPT --x--"
|
2017-11-29 19:49:05 +01:00
|
|
|
TMPFILE=`mktemp`
|
2018-04-20 15:21:06 +02:00
|
|
|
echo "+ spatch --sp-file $SCRIPT $args ..."
|
|
|
|
spatch --sp-file $SCRIPT $args $files 2>"$TMPFILE" || cat "$TMPFILE"
|
2017-11-29 19:49:05 +01:00
|
|
|
rm "$TMPFILE"
|
2018-03-23 15:44:10 +01:00
|
|
|
echo -e "--x-- Processed $SCRIPT --x--\n"
|
2017-11-29 19:49:05 +01:00
|
|
|
done
|