mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-03 00:53:32 +01:00
a2bb66c355
This will let us give specific in-file equivalents to given macros or preprocessor directives, to make things parse.
30 lines
780 B
Bash
Executable File
30 lines
780 B
Bash
Executable File
#!/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"
|