.. | .. |
---|
8 | 8 | my $output_file = "MAINTAINERS.new"; |
---|
9 | 9 | my $output_section = "SECTION.new"; |
---|
10 | 10 | my $help = 0; |
---|
11 | | - |
---|
| 11 | +my $order = 0; |
---|
12 | 12 | my $P = $0; |
---|
13 | 13 | |
---|
14 | 14 | if (!GetOptions( |
---|
15 | 15 | 'input=s' => \$input_file, |
---|
16 | 16 | 'output=s' => \$output_file, |
---|
17 | 17 | 'section=s' => \$output_section, |
---|
| 18 | + 'order!' => \$order, |
---|
18 | 19 | 'h|help|usage' => \$help, |
---|
19 | 20 | )) { |
---|
20 | 21 | die "$P: invalid argument - use --help if necessary\n"; |
---|
.. | .. |
---|
32 | 33 | --input => MAINTAINERS file to read (default: MAINTAINERS) |
---|
33 | 34 | --output => sorted MAINTAINERS file to write (default: MAINTAINERS.new) |
---|
34 | 35 | --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 |
---|
35 | 52 | |
---|
36 | 53 | If <pattern match regexes> exist, then the sections that match the |
---|
37 | 54 | regexes are not written to the output file but are written to the |
---|
.. | .. |
---|
56 | 73 | |
---|
57 | 74 | sub by_pattern($$) { |
---|
58 | 75 | my ($a, $b) = @_; |
---|
59 | | - my $preferred_order = 'MRPLSWTQBCFXNK'; |
---|
| 76 | + my $preferred_order = 'MRLSWQBCPTFXNK'; |
---|
60 | 77 | |
---|
61 | 78 | my $a1 = uc(substr($a, 0, 1)); |
---|
62 | 79 | my $b1 = uc(substr($b, 0, 1)); |
---|
.. | .. |
---|
105 | 122 | print $file $separator; |
---|
106 | 123 | } |
---|
107 | 124 | 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 | + } |
---|
110 | 133 | } |
---|
111 | 134 | } |
---|
112 | 135 | } |
---|