2019-09-12 00:44:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Echo the name of every argument of this script that is not "perfect"
|
|
|
|
# according to coccinelle's --parse-c.
|
|
|
|
|
|
|
|
top="$(dirname "$0")/../.."
|
|
|
|
|
2019-10-09 15:31:10 +02:00
|
|
|
exitcode=0
|
|
|
|
|
2019-09-12 00:44:10 +02:00
|
|
|
for fn in "$@"; do
|
|
|
|
|
|
|
|
if spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
|
2019-10-09 16:07:50 +02:00
|
|
|
-I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \
|
|
|
|
--parse-c "$fn" \
|
2019-09-12 00:44:10 +02:00
|
|
|
2>/dev/null | grep "perfect = 1" > /dev/null; then
|
|
|
|
: # it's perfect
|
|
|
|
else
|
|
|
|
echo "$fn"
|
2019-10-09 15:31:10 +02:00
|
|
|
if test "${VERBOSE}" != ""; then
|
|
|
|
spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
|
2019-10-09 16:07:50 +02:00
|
|
|
-I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \
|
|
|
|
--parse-c "$fn"
|
2019-10-09 15:31:10 +02:00
|
|
|
fi
|
|
|
|
exitcode=1
|
2019-09-12 00:44:10 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
2019-10-09 15:31:10 +02:00
|
|
|
|
|
|
|
exit "$exitcode"
|