From cf2a9bdd12b529b95e85a0f940ad8c08506b0a61 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sat, 5 Aug 2017 18:45:49 -0700 Subject: [PATCH] parse-maintainers: Move matching sections from MAINTAINERS Allow any number of command line arguments to match either the section header or the section contents and create new files. Create MAINTAINERS.new and SECTION.new. This allows scripting of the movement of various sections from MAINTAINERS. Signed-off-by: Joe Perches Signed-off-by: Linus Torvalds --- scripts/parse-maintainers.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/parse-maintainers.pl b/scripts/parse-maintainers.pl index c286154a2b686..e40b53db7f9fd 100644 --- a/scripts/parse-maintainers.pl +++ b/scripts/parse-maintainers.pl @@ -109,8 +109,20 @@ sub file_input { } my %hash; +my %new_hash; file_input(\%hash, "MAINTAINERS"); + +foreach my $type (@ARGV) { + foreach my $key (keys %hash) { + if ($key =~ /$type/ || $hash{$key} =~ /$type/) { + $new_hash{$key} = $hash{$key}; + delete $hash{$key}; + } + } +} + alpha_output(\%hash, "MAINTAINERS.new"); +alpha_output(\%new_hash, "SECTION.new"); exit(0); -- 2.39.5