From 184d7357077e4dd4807e647a402c974931172924 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 20 Oct 2020 18:54:49 +0200 Subject: [PATCH] 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 --- scripts/kconfig.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl index 6a6bbd2747..392f1d5841 100755 --- a/scripts/kconfig.pl +++ b/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; -- 2.30.2