From d1d6fc5cff0cf79bc2488e376eb1303fa13bf33d Mon Sep 17 00:00:00 2001 From: David Gross Date: Wed, 10 May 2017 10:49:44 -0700 Subject: [PATCH] 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 --- envsetup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index a31b9d869c..b71a8256ad 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1241,7 +1241,7 @@ case `uname -s` in 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 @@ case `uname -s` in *) 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 "$@" {} + }