From 819e67242fa632f465f002396dc7adaec9418ab3 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 25 Jan 2016 16:38:05 -0700 Subject: kconfig_lint: merge 'git grep' and 'grep' exclude dir and files The code had originally been using standard grep to look through the coreboot tree for Kconfig symbols. When this was switched to git grep, the --exclude-dir options didn't work, and nothing was added to exclude the directories that shouldn't be searched for symbols. This resulted in invalid warnings as it searched directories that had Kconfig symbols for other projects. This merges the exclusion list for both the regular and git versions of grep for consistent behavior. Change-Id: I7fed8b9fa827cb14f7373e7b774acc56e43cb6ff Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/13459 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/lint/kconfig_lint | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'util/lint') diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 2cb125e4b8..93843367ff 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -612,6 +612,21 @@ sub build_and_parse_kconfig_tree { show_error("$line ($filename:$line_no unrecognized)"); } + if ( defined $inside_menu[0] ) { + $parseline[0]{menus} = ""; + } + else { + $parseline[0]{menus} = "top"; + } + + my $i = 0; + while ( defined $inside_menu[$i] ) { + $parseline[0]{menus} .= "$inside_menu[$i]"; + $i++; + if ( defined $inside_menu[$i] ) { + $parseline[0]{menus} .= "->"; + } + } push @wholeconfig, @parseline; } } @@ -1135,7 +1150,7 @@ sub print_wholeconfig { #replace tabs with spaces for consistency $line->{text} =~ s/\t/ /g; - printf "%-120s # $line->{filename} line $line->{file_line_no}\n", $line->{text}; + printf "%-120s # $line->{filename} line $line->{file_line_no} ($line->{menus})\n", $line->{text}; } } -- cgit v1.2.3