summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-31 12:56:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-31 12:56:37 +0200
commit50849f6e8b86cd7eb163a42d89e911da3eff04ee (patch)
treea7723fc7d14734bb1a59b0a6224db3d516e21d45
parent6c6a7fffcb03895ffe498dae3c46c35c70231ff0 (diff)
Add review script
-rwxr-xr-xreview43
1 files changed, 43 insertions, 0 deletions
diff --git a/review b/review
new file mode 100755
index 0000000..d9d4b07
--- /dev/null
+++ b/review
@@ -0,0 +1,43 @@
+#! /usr/bin/env bash
+
+# Grep for @@ items in build2 toolchain.
+#
+# Usage: review
+#
+usage="usage: $0"
+
+modules="libbutl build2 libbpkg bpkg brep build2-toolchain"
+extras="etc private"
+
+owd=`pwd`
+trap "{ cd $owd; exit 1; }" ERR
+set -o errtrace # Trap in functions.
+
+function info () { echo "$*" 1>&2; }
+function error () { info "$*"; exit 1; }
+
+for m in $modules; do
+ # Top-level directories inside the module to exclude.
+ #
+ exclude=.git
+
+ # Exclude submodules in build2-toolchain.
+ #
+ if [ $m = "build2-toolchain" ]; then
+ exclude="$exclude bpkg build2 libbutl libbpkg"
+ fi
+
+ fo=
+ if [ "$exclude" ]; then
+ fo="-type d ("
+ for e in $exclude; do
+ fo="$fo -path $m/$e -o"
+ done
+ fo="$fo -false ) -prune -o"
+ fi
+ fo="$fo -type f -print"
+
+ for f in `find $m $fo`; do
+ grep --color=auto --with-filename '@@' $f || true
+ done
+done