Systemd/coccinelle/run-coccinelle.sh

13 lines
360 B
Bash
Raw Normal View History

#!/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