]> git.proxmox.com Git - mirror_lxc.git/blame - coccinelle/run-coccinelle.sh
network: record created_name for instantiate_ipvlan()
[mirror_lxc.git] / coccinelle / run-coccinelle.sh
CommitLineData
99dc3a33
CB
1#!/bin/bash -e
2
3top="$(git rev-parse --show-toplevel)"
4files="$(git ls-files ':/*.[ch]')"
5args=
6
7case "$1" in
8 -i)
9 args="$args --in-place"
10 shift
11 ;;
12esac
13
14if ! parallel -h >/dev/null; then
15 echo 'Please install GNU parallel (package "parallel")'
16 exit 1
17fi
18
19for SCRIPT in ${@-$top/coccinelle/*.cocci} ; do
20 echo "--x-- Processing $SCRIPT --x--"
21 TMPFILE=`mktemp`
22 echo "+ spatch --sp-file $SCRIPT $args ..."
23 parallel --halt now,fail=1 --keep-order --noswap --max-args=20 \
24 spatch --sp-file $SCRIPT $args ::: $files \
25 2>"$TMPFILE" || cat "$TMPFILE"
26 echo -e "--x-- Processed $SCRIPT --x--\n"
27done