Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36626 )
Change subject: util/lint/kconfig_lint: Handle glob prefix and suffix ......................................................................
util/lint/kconfig_lint: Handle glob prefix and suffix
Change-Id: I9067a95ff171d6da58583b3d4f15596b4584d937 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/36626 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Martin Roth martinroth@google.com --- M util/lint/kconfig_lint 1 file changed, 6 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved Nico Huber: Looks good to me, approved
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 47f0494..1545c82 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -1213,9 +1213,11 @@ 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 @@ 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 );