aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-10-20 18:54:49 +0200
committerFelix Fietkau <nbd@nbd.name>2020-11-13 13:17:53 +0100
commit184d7357077e4dd4807e647a402c974931172924 (patch)
tree9f4a1b73a578712f24463ba5dd34f5e150ca6b98 /scripts
parentf307684ab2e03c37028aff6087d700fb48935648 (diff)
downloadupstream-184d7357077e4dd4807e647a402c974931172924.tar.gz
upstream-184d7357077e4dd4807e647a402c974931172924.tar.bz2
upstream-184d7357077e4dd4807e647a402c974931172924.zip
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kconfig.pl11
1 files 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;