coccinelle: run spatch just on version-controlled files
Also, allow run-cocinnelle.sh to be started from any directory. Unfortunately set -x does not work nicely anymore, because the list is too verbose. Replace it by an echo line.
This commit is contained in:
parent
cb747347ac
commit
31d31f2021
|
@ -1,9 +1,12 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
for SCRIPT in ${@-*.cocci} ; do
|
files="$(git ls-files ':/*.[ch]')"
|
||||||
|
|
||||||
|
for SCRIPT in ${@-coccinelle/*.cocci} ; do
|
||||||
echo "--x-- Processing $SCRIPT --x--"
|
echo "--x-- Processing $SCRIPT --x--"
|
||||||
TMPFILE=`mktemp`
|
TMPFILE=`mktemp`
|
||||||
( set -x ; spatch --sp-file $SCRIPT --dir $PWD/.. 2> "$TMPFILE" || cat "$TMPFILE" )
|
echo "+ spatch --sp-file $SCRIPT ..."
|
||||||
|
spatch --sp-file $SCRIPT $files 2>"$TMPFILE" || cat "$TMPFILE"
|
||||||
rm "$TMPFILE"
|
rm "$TMPFILE"
|
||||||
echo -e "--x-- Processed $SCRIPT --x--\n"
|
echo -e "--x-- Processed $SCRIPT --x--\n"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue