X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2FcheckAUTHORS.pl;h=9e3f26437a9c0274dcc398517e93ed237b62442e;hb=102b13d314016f7ec14c00406088a88475fe52db;hp=1eae53d8389fa83f396aef77fc42f10b891c6dbd;hpb=15b8f96d46c4164722f0c24dfb7e92d280880305;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl index 1eae53d..9e3f264 100644 --- a/Porting/checkAUTHORS.pl +++ b/Porting/checkAUTHORS.pl @@ -5,12 +5,14 @@ $Text::Wrap::columns = 80; my ($committer, $patch, $log); use Getopt::Long; -my ($rank, $percentage, $ta, @authors, %authors, %untraced, %patchers, - %committers); +my ($rank, $percentage, $cumulative, $reverse, $ta, @authors, %authors, + %untraced, %patchers, %committers); my $result = GetOptions ("rank" => \$rank, # rank authors "thanks-applied" => \$ta, # ranks committers "acknowledged=s" => \@authors , # authors files "percentage" => \$percentage, # show as %age + "cumulative" => \$cumulative, + "reverse" => \$reverse, ); if (!$result or (($rank||0) + ($ta||0) + (@authors ? 1 : 0) != 1) or !@ARGV) { @@ -19,6 +21,8 @@ $0 --rank Changelogs # rank authors by patches $0 --acknowledged Changelogs # Display unacknowledged authors $0 --thanks-applied Changelogs # ranks committers $0 --percentage ... # show rankings as percentages +$0 --cumulative ... # show rankings cumulatively +$0 --reverse ... # show rankings in reverse Specify stdin as - if needs be. Remember that option names can be abbreviated. EOS } @@ -120,7 +124,7 @@ my %map = reverse ( $map{"autrijus\100egb.elixus.org"} = $map{"autrijus\100geb.elixus.org"} = $map{"autrijus\100gmail.com"} = $map{"autrijus\100ossf.iis.sinica.edu.tw"} - = "autrijus\100autrijus.org"; + = $map{"autrijus\100autrijus.org"} = "cpan\100audreyt.org"; $map{"ilya\100math.ohio-state.edu"} = $map{"ilya\100math.berkeley.edu"} = $map{"ilya\100math.berkeley.edu"} = "nospam-abuse\100ilyaz.org"; $map{"philip.newton\100gmx.net"} = $map{"philip.newton\100datenrevision.de"} @@ -176,6 +180,7 @@ $map{"beau\100beaucox.com"} = "?"; $map{"rgarciasuarez\100mandrakesoft.com"} = $map{"rgarciasuarez\100mandriva.com"} + = $map{"rgarciasuarez\100gmail.com"} = $map{"raphel.garcia-suarez\100hexaflux.com"} = "rgs"; $map{"jhietaniemi\100gmail.com"} = $map{"jhi\100kosh.hut.fi"} = $map{"jhi\100cc.hut.fi"} = $map{"jarkko.hietaniemi\100nokia.com"} = "jhi"; @@ -194,6 +199,7 @@ $map{"h.m.brand\100hccnet.nl"} = $map{"merijn\100l1.procura.nl"} = "merijn"; $map{"nik\100tiuk.ti.com"} = $map{"nick.ing-simmons\100elixent.com"} = "nick"; $map{"hv\100crypt.org"} = "hv"; $map{"gisle\100aas.no"} = "gisle"; +$map{"gsar\100cpan.org"} = "gsar"; if (@authors) { my %raw; @@ -281,14 +287,18 @@ sub display_ordered { } my $i = @sorted; - return unless $i; - while (--$i) { + return unless @sorted; + my $sum = 0; + foreach my $i ($reverse ? 0 .. $#sorted : reverse 0 .. $#sorted) { next unless $sorted[$i]; my $prefix; + $sum += $i * @{$sorted[$i]}; + # Value to display is either this one, or the cumulative sum. + my $value = $cumulative ? $sum : $i; if ($percentage) { - $prefix = sprintf "% 6.2f:\t", 100 * $i / $total; + $prefix = sprintf "%6.2f:\t", 100 * $value / $total; } else { - $prefix = "$i:\t"; + $prefix = "$value:\t"; } print wrap ($prefix, "\t", join (" ", sort @{$sorted[$i]}), "\n"); }