Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/66637 )
Change subject: util/lint: fall back to regular grep in kconfig_lint ......................................................................
util/lint: fall back to regular grep in kconfig_lint
Automatically fall back to using regular grep if working outside a git repository and the option to use regular grep is not specified
Signed-off-by: Solomon Alan-Dei alandei.solomon@gmail.com Change-Id: I0cdecf01a0e74c30947c4fe7e7c7d9457a5165a1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66637 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin L Roth gaumless@gmail.com --- M util/lint/kconfig_lint 1 file changed, 22 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Martin L Roth: Looks good to me, approved
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 32bf92d..f2a732d 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -58,7 +58,12 @@ #------------------------------------------------------------------------------- sub Main {
- check_arguments(); + check_arguments(); + if ( !($dont_use_git_grep || `git rev-parse --is-inside-work-tree`) ) { + $dont_use_git_grep = 1; + print STDERR "\nGit grep unavailable, falling back to regular grep...\n"; + } + open( STDOUT, "> $output_file" ) or die "Can't open $output_file for output: $!\n";
if ( defined $top_dir ) {