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>
This commit is contained in:
Solomon Alan-Dei 2022-08-11 11:13:28 -06:00 committed by Martin L Roth
parent 7c09e546af
commit a6e60f043b
1 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,12 @@ Main();
#-------------------------------------------------------------------------------
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 ) {