Teach mgrep to find soong/*.go files.
Test: $ cd $ANDROID_BUILD_TOP
$ mgrep FORCE_BUILD_LLVM_DEBUG
./external/llvm/llvm-host-build.mk:24:ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
./external/llvm/soong/llvm.go:44: if ctx.AConfig().IsEnvTrue("FORCE_BUILD_LLVM_DEBUG") {
$ cd external/llvm
$ mgrep FORCE_BUILD_LLVM_DEBUG
./llvm-host-build.mk:24:ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
./soong/llvm.go:44: if ctx.AConfig().IsEnvTrue("FORCE_BUILD_LLVM_DEBUG") {
Change-Id: Ibe114550a8022d792a0c10c766c964a67721a6ba
diff --git a/envsetup.sh b/envsetup.sh
index a31b9d8..b71a825 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1241,7 +1241,7 @@
Darwin)
function mgrep()
{
- find -E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -type f -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' \
+ find -E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regex '(.*/)?soong/[^/]*.go' \) -type f \
-exec grep --color -n "$@" {} +
}
@@ -1255,7 +1255,7 @@
*)
function mgrep()
{
- find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -type f \
+ find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regextype posix-extended -regex '(.*/)?soong/[^/]*.go' \) -type f \
-exec grep --color -n "$@" {} +
}