X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2FcheckAUTHORS.pl;h=6fa47bb6a70c46ec87c9bc680110bc052929c3e9;hb=5e71429c61042c39fcfb4ddc34df477a9d592d08;hp=a4e7c3fb380a54642cf695c90b6e2fa1adff1a38;hpb=0ad39044976812f3d7577556791797d57eb65d61;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl index a4e7c3f..6fa47bb 100644 --- a/Porting/checkAUTHORS.pl +++ b/Porting/checkAUTHORS.pl @@ -5,16 +5,24 @@ $Text::Wrap::columns = 80; my ($committer, $patch, $log); use Getopt::Long; -my ($rank, $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 + "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) { die <<"EOS"; $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 } @@ -107,6 +115,8 @@ my %map = reverse ( "paul.green\100stratus.com" => "paul_greenvos\100vos.stratus.com", "alian\100cpan.org" => "alian\100alianwebserver.com", + "david.dyck\100fluke.com" => "dcd\100tc.fluke.com", + "jdhedden\100" . "1979.usna.com" => "jdhedden\100cpan.org", # Maybe we should special case this to get real names out? "perlbug\100perl.org" => "perlbug-followup\100perl.org", ); @@ -115,7 +125,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"} @@ -152,7 +162,7 @@ $map{"me-02\100ton.iguana.be"} = $map{"perl-5.8.0\100ton.iguana.be"} = $map{"perl5-porters\100ton.iguana.be"} = "!"; # No real name for these address $map{$_} = "?" foreach ("grommel\100sears.com", "pxm\100nubz.org", - "padre\100elte.hu", "jdhedden\100" . "1979.usna.com", + "padre\100elte.hu", "nothingmuch\100woobling.org", "bob\100starlabs.net", "bbucklan\100jpl-devvax.jpl.nasa.gov", "bilbo\100ua.fm", "mats\100sm5sxl.net", @@ -171,6 +181,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"; @@ -189,6 +200,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; @@ -232,6 +244,7 @@ while (<>) { my $prefix = " " x length $1; LOG: while (<>) { next if /^$/; + s/^\t/ /; if (s/^$prefix//) { $log .= $_; } elsif (/^\s+Branch:/) { @@ -268,15 +281,27 @@ if ($rank) { sub display_ordered { my $what = shift; my @sorted; + my $total; while (my ($name, $count) = each %$what) { push @{$sorted[$count]}, $name; + $total += $count; } 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]; - print wrap ("$i:\t", "\t", join (" ", sort @{$sorted[$i]}), "\n"); + 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 * $value / $total; + } else { + $prefix = "$value:\t"; + } + print wrap ($prefix, "\t", join (" ", sort @{$sorted[$i]}), "\n"); } }