From 55f01326cc04f8366a451bcaa4308531281a32d4 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 5 Nov 2019 12:06:59 +0100 Subject: util/lint/kconfig_lint: Handle glob prefix and suffix Change-Id: I9067a95ff171d6da58583b3d4f15596b4584d937 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/36626 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Martin Roth --- util/lint/kconfig_lint | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'util/lint') diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 47f04941f2..1545c8299b 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -1213,9 +1213,11 @@ sub load_kconfig_file { my @dir_file_data; #recursively handle coreboot's new source glob operator - if ( $input_file =~ /^(.*?)\/\*\/(.*)$/ ) { + if ( $input_file =~ /^(.*?)\/(\w*)\*(\w*)\/(.*)$/ ) { my $dir_prefix = $1; - my $dir_suffix = $2; + my $dir_glob_prefix = $2; + my $dir_glob_suffix = $3; + my $dir_suffix = $4; if ( -d "$dir_prefix" ) { opendir( D, "$dir_prefix" ) || die "Can't open directory '$dir_prefix'\n"; @@ -1225,7 +1227,8 @@ sub load_kconfig_file { while ( my $directory = shift @dirlist ) { #ignore non-directory files - if ( ( -d "$dir_prefix/$directory" ) && !( $directory =~ /^\..*/ ) ) { + if ( ( -d "$dir_prefix/$directory" ) && !( $directory =~ /^\..*/ ) + && ( $directory =~ /\Q$dir_glob_prefix\E.*\Q$dir_glob_suffix\E/ ) ) { push @dir_file_data, load_kconfig_file( "$dir_prefix/$directory/$dir_suffix", $input_file, $loadline, 1, $loadfile, $loadline ); -- cgit v1.2.3