#! /usr/bin/env bash # Grep for @@ items in build2 toolchain. # # Usage: review # usage="usage: $0" modules="libbutl build2 libbpkg bpkg bdep brep libbbot bbot libstd-modules build2-toolchain" 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 bdep bpkg build2 libbutl libbpkg libodb libodb-sqlite libsqlite3 libpkgconf" 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 --binary-files=without-match --color=always --with-filename \ '@@' $f || true done done