]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: add a run-coccinelle.sh script that runs all scripts
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Nov 2017 18:49:05 +0000 (19:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Nov 2017 19:12:26 +0000 (20:12 +0100)
One day we should start running something like this as part of CI so
that non-well-formed commits are not even accepted...

coccinelle/run-coccinelle.sh [new file with mode: 0755]

diff --git a/coccinelle/run-coccinelle.sh b/coccinelle/run-coccinelle.sh
new file mode 100755 (executable)
index 0000000..fe3aeb6
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash -e
+
+for SCRIPT in *.cocci ; do
+        [ "$SCRIPT" = "empty-if.cocci" ] && continue
+        echo "--x-- Processing $SCRIPT --x--"
+        TMPFILE=`mktemp`
+        spatch --sp-file $SCRIPT --dir $(pwd)/.. 2> "$TMPFILE" || cat "$TMPFILE"
+        rm "$TMPFILE"
+        echo "--x-- Processed $SCRIPT --x--"
+        echo ""
+done