[tor-commits] [tor/master] try_parse.sh: add a verbose mode and a meaningful exit code.

teor at torproject.org teor at torproject.org
Thu Oct 24 00:01:21 UTC 2019


commit 51c2097586dd6133a862985ab68ded85736d40e8
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Oct 9 09:31:10 2019 -0400

    try_parse.sh: add a verbose mode and a meaningful exit code.
---
 scripts/coccinelle/try_parse.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/coccinelle/try_parse.sh b/scripts/coccinelle/try_parse.sh
index 865c85570..303324294 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"





More information about the tor-commits mailing list