소스 검색

scripts/kconfig.pl: allow regex syntax in filtering out config entries

This will be used to filter out some autogenerated config values from
the kernel config files

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 5 년 전
부모
커밋
184d735707
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      scripts/kconfig.pl

+ 9 - 2
scripts/kconfig.pl

@@ -102,8 +102,15 @@ sub config_sub($$) {
 	my $cfg1 = shift;
 	my $cfg2 = shift;
 	my %config = %{$cfg1};
-	
-	foreach my $config (keys %$cfg2) {
+	my @keys = map {
+		my $expr = $_;
+		$expr =~ /[?.*]/ ?
+			map {
+				/^$expr$/ ? $_ : ()
+			} keys %config : $expr;
+	} keys %$cfg2;
+
+	foreach my $config (@keys) {
 		delete $config{$config};
 	}
 	return \%config;