]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/run-coccinelle.sh
Merge pull request #9221 from poettering/bus-track-destroy
[thirdparty/systemd.git] / coccinelle / run-coccinelle.sh
1 #!/bin/bash -e
2
3 top="$(git rev-parse --show-toplevel)"
4 files="$(git ls-files ':/*.[ch]')"
5 args=
6
7 case "$1" in
8 -i)
9 args="$args --in-place"
10 shift
11 ;;
12 esac
13
14 for SCRIPT in ${@-$top/coccinelle/*.cocci} ; do
15 echo "--x-- Processing $SCRIPT --x--"
16 TMPFILE=`mktemp`
17 echo "+ spatch --sp-file $SCRIPT $args ..."
18 spatch --sp-file $SCRIPT $args $files 2>"$TMPFILE" || cat "$TMPFILE"
19 rm "$TMPFILE"
20 echo -e "--x-- Processed $SCRIPT --x--\n"
21 done