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 <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2020-10-20 18:54:49 +02:00
parent f307684ab2
commit 184d735707
1 changed files with 9 additions and 2 deletions

View File

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