]>
git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/run-coccinelle.sh
3 # Exclude following paths from the Coccinelle transformations
8 # Symlinked to test-bus-vtable-cc.cc, which causes issues with the IN_SET macro
9 "src/libsystemd/sd-bus/test-bus-vtable.c"
12 top
="$(git rev-parse --show-toplevel)"
13 iso_defs
="$top/coccinelle/systemd-definitions.iso"
16 # Create an array from files tracked by git...
17 mapfile
-t files
< <(git ls-files
':/*.[ch]')
18 # ...and filter everything that matches patterns from EXCLUDED_PATHS
19 for excl
in "${EXCLUDED_PATHS[@]}"; do
20 files
=(${files[@]//$excl})
25 args
="$args --in-place"
30 if ! parallel
-h >/dev
/null
; then
31 echo 'Please install GNU parallel (package "parallel")'
35 for SCRIPT
in ${@-$top/coccinelle/*.cocci} ; do
36 echo "--x-- Processing $SCRIPT --x--"
38 echo "+ spatch --sp-file $SCRIPT $args ..."
39 parallel
--halt now
,fail
=1 --keep-order --noswap --max-args=20 \
40 spatch
--iso-file $iso_defs --sp-file $SCRIPT $args ::: "${files[@]}" \
41 2>"$TMPFILE" ||
cat "$TMPFILE"
42 echo -e "--x-- Processed $SCRIPT --x--\n"