summaryrefslogtreecommitdiff
path: root/coccinelle
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-04-20 15:07:42 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-04 11:48:50 +0200
commit31d31f20218aabe63cd714da7f5f2fca94c98ef4 (patch)
tree34c791951365a549af0dab03b1ade5efc30fa988 /coccinelle
parentcb747347acc5ee1b8932c8177985db14cb33319c (diff)
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.
Diffstat (limited to 'coccinelle')
-rwxr-xr-xcoccinelle/run-coccinelle.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/coccinelle/run-coccinelle.sh b/coccinelle/run-coccinelle.sh
index f463f5eed5..8c4ed07dd8 100755
--- a/coccinelle/run-coccinelle.sh
+++ b/coccinelle/run-coccinelle.sh
@@ -1,9 +1,12 @@
#!/bin/bash -e
-for SCRIPT in ${@-*.cocci} ; do
+files="$(git ls-files ':/*.[ch]')"
+
+for SCRIPT in ${@-coccinelle/*.cocci} ; do
echo "--x-- Processing $SCRIPT --x--"
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"
echo -e "--x-- Processed $SCRIPT --x--\n"
done