]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a script to run spatch with appropriate arguments
authorNick Mathewson <nickm@torproject.org>
Wed, 11 Sep 2019 22:43:16 +0000 (18:43 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 11 Sep 2019 22:43:16 +0000 (18:43 -0400)
It's a bit tricky to remember the right incantation to get the
proper include paths and incantations for coccinelle, but without
it, coccinelle is less effective at parsing our C.

scripts/coccinelle/apply.sh [new file with mode: 0755]

diff --git a/scripts/coccinelle/apply.sh b/scripts/coccinelle/apply.sh
new file mode 100755 (executable)
index 0000000..82e773d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# apply.sh:
+# run spatch with appropriate includes and builtins for the Tor source code
+
+top="$(dirname "$0")/../.."
+
+spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
+       -I "$top" -I "$top"/src -I "$top"/ext "$@"