diff options
Diffstat (limited to 'scripts/coccinelle/try_parse.sh')
-rwxr-xr-x | scripts/coccinelle/try_parse.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/coccinelle/try_parse.sh b/scripts/coccinelle/try_parse.sh new file mode 100755 index 0000000000..0f91e31702 --- /dev/null +++ b/scripts/coccinelle/try_parse.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Echo the name of every argument of this script that is not "perfect" +# according to coccinelle's --parse-c. + +top="$(dirname "$0")/../.." + +exitcode=0 + +for fn in "$@"; do + + if spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \ + -I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \ + --parse-c "$fn" \ + 2>/dev/null | grep "perfect = 1" > /dev/null; then + : # it's perfect + else + echo "$fn" + if test "${VERBOSE}" != ""; then + spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \ + -I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \ + --parse-c "$fn" + fi + exitcode=1 + fi + +done + +exit "$exitcode" |