summaryrefslogtreecommitdiff
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-09 09:31:10 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 09:24:25 -0400
commit51c2097586dd6133a862985ab68ded85736d40e8 (patch)
tree34bd70eb601e0044c9dc8538d3e0c1339fcd16d2 /scripts/coccinelle
parent9ab96550da079abe048d1e0e2065e3fb85634cda (diff)
downloadtor-51c2097586dd6133a862985ab68ded85736d40e8.tar.gz
tor-51c2097586dd6133a862985ab68ded85736d40e8.zip
try_parse.sh: add a verbose mode and a meaningful exit code.
Diffstat (limited to 'scripts/coccinelle')
-rwxr-xr-xscripts/coccinelle/try_parse.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/coccinelle/try_parse.sh b/scripts/coccinelle/try_parse.sh
index 865c85570a..3033242946 100755
--- a/scripts/coccinelle/try_parse.sh
+++ b/scripts/coccinelle/try_parse.sh
@@ -5,6 +5,8 @@
top="$(dirname "$0")/../.."
+exitcode=0
+
for fn in "$@"; do
if spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
@@ -13,6 +15,13 @@ for fn in "$@"; do
: # 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 --parse-c "$fn"
+ fi
+ exitcode=1
fi
done
+
+exit "$exitcode"