diff options
author | Solomon Alan-Dei <alandei.solomon@gmail.com> | 2022-08-11 11:13:28 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-10-29 15:43:18 +0000 |
commit | a6e60f043bc626eac58074a6b64ef04f00071f96 (patch) | |
tree | 80a9dfa9991d1f9a1e2e8021e6ca7fa00de56451 /util/lint | |
parent | 7c09e546af08203f26fb0794c8ba983437e8a29d (diff) |
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>
Diffstat (limited to 'util/lint')
-rwxr-xr-x | util/lint/kconfig_lint | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 32bf92dc4d..f2a732d92b 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -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 ) { |