hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/parse-maintainers.pl
....@@ -8,13 +8,14 @@
88 my $output_file = "MAINTAINERS.new";
99 my $output_section = "SECTION.new";
1010 my $help = 0;
11
-
11
+my $order = 0;
1212 my $P = $0;
1313
1414 if (!GetOptions(
1515 'input=s' => \$input_file,
1616 'output=s' => \$output_file,
1717 'section=s' => \$output_section,
18
+ 'order!' => \$order,
1819 'h|help|usage' => \$help,
1920 )) {
2021 die "$P: invalid argument - use --help if necessary\n";
....@@ -32,6 +33,22 @@
3233 --input => MAINTAINERS file to read (default: MAINTAINERS)
3334 --output => sorted MAINTAINERS file to write (default: MAINTAINERS.new)
3435 --section => new sorted MAINTAINERS file to write to (default: SECTION.new)
36
+ --order => Use the preferred section content output ordering (default: 0)
37
+ Preferred ordering of section output is:
38
+ M: Person acting as a maintainer
39
+ R: Person acting as a patch reviewer
40
+ L: Mailing list where patches should be sent
41
+ S: Maintenance status
42
+ W: URI for general information
43
+ Q: URI for patchwork tracking
44
+ B: URI for bug tracking/submission
45
+ C: URI for chat
46
+ P: URI or file for subsystem specific coding styles
47
+ T: SCM tree type and location
48
+ F: File and directory pattern
49
+ X: File and directory exclusion pattern
50
+ N: File glob
51
+ K: Keyword - patch content regex
3552
3653 If <pattern match regexes> exist, then the sections that match the
3754 regexes are not written to the output file but are written to the
....@@ -56,7 +73,7 @@
5673
5774 sub by_pattern($$) {
5875 my ($a, $b) = @_;
59
- my $preferred_order = 'MRPLSWTQBCFXNK';
76
+ my $preferred_order = 'MRLSWQBCPTFXNK';
6077
6178 my $a1 = uc(substr($a, 0, 1));
6279 my $b1 = uc(substr($b, 0, 1));
....@@ -105,8 +122,14 @@
105122 print $file $separator;
106123 }
107124 print $file $key . "\n";
108
- foreach my $pattern (sort by_pattern split('\n', %$hashref{$key})) {
109
- print $file ($pattern . "\n");
125
+ if ($order) {
126
+ foreach my $pattern (sort by_pattern split('\n', %$hashref{$key})) {
127
+ print $file ($pattern . "\n");
128
+ }
129
+ } else {
130
+ foreach my $pattern (split('\n', %$hashref{$key})) {
131
+ print $file ($pattern . "\n");
132
+ }
110133 }
111134 }
112135 }