summaryrefslogtreecommitdiff
path: root/coccinelle/run-coccinelle.sh
blob: 8c4ed07dd8b97a7b22ec9cd4ad4a633777abaca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash -e

files="$(git ls-files ':/*.[ch]')"

for SCRIPT in ${@-coccinelle/*.cocci} ; do
        echo "--x-- Processing $SCRIPT --x--"
        TMPFILE=`mktemp`
        echo "+ spatch --sp-file $SCRIPT ..."
        spatch --sp-file $SCRIPT $files 2>"$TMPFILE" || cat "$TMPFILE"
        rm "$TMPFILE"
        echo -e "--x-- Processed $SCRIPT --x--\n"
done