This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Clean up the new maintainers.t to be a bit more sensible about paths
[perl5.git] / Porting / checkAUTHORS.pl
CommitLineData
5649b9c9
NC
1#!/usr/bin/perl -w
2use strict;
3use Text::Wrap;
4$Text::Wrap::columns = 80;
5my ($committer, $patch, $log);
6use Getopt::Long;
7
2b0ba25f
NC
8my ($rank, $percentage, $cumulative, $reverse, $ta, @authors, %authors,
9 %untraced, %patchers, %committers);
ff4d71b5
NC
10my $result = GetOptions ("rank" => \$rank, # rank authors
11 "thanks-applied" => \$ta, # ranks committers
15b8f96d
NC
12 "acknowledged=s" => \@authors , # authors files
13 "percentage" => \$percentage, # show as %age
2b0ba25f
NC
14 "cumulative" => \$cumulative,
15 "reverse" => \$reverse,
15b8f96d 16 );
5649b9c9 17
ff4d71b5 18if (!$result or (($rank||0) + ($ta||0) + (@authors ? 1 : 0) != 1) or !@ARGV) {
5649b9c9
NC
19 die <<"EOS";
20$0 --rank Changelogs # rank authors by patches
21$0 --acknowledged <authors file> Changelogs # Display unacknowledged authors
ff4d71b5 22$0 --thanks-applied Changelogs # ranks committers
15b8f96d 23$0 --percentage ... # show rankings as percentages
2b0ba25f
NC
24$0 --cumulative ... # show rankings cumulatively
25$0 --reverse ... # show rankings in reverse
5649b9c9
NC
26Specify stdin as - if needs be. Remember that option names can be abbreviated.
27EOS
28}
29
8513229b
A
30
31my $prev = "";
32my %map;
33
34while (<DATA>) {
35 chomp;
36 s/\\100/\@/g;
37 $_ = lc;
38 if (my ($correct, $alias) = /^\s*([^#\s]\S*)\s+(.*\S)/) {
8b80c7bd 39 $correct =~ s/^\\043/#/;
8513229b
A
40 if ($correct eq '+') {$correct = $prev} else {$prev = $correct}
41 $map {$alias} = $correct;
42 }
43}
44
45#
46# Email addresses for we do not have names.
47#
48$map {$_} = "?" for
4bc69901 49 "agrow\100thegotonerd.com",
8513229b
A
50 "alexander_bluhm\100genua.de",
51 "alexander_gernler\100genua.de",
52 "ammon\100rhythm.com",
8b80c7bd 53 "andrew\100sundale.net",
8513229b
A
54 "bah\100longitude.com",
55 "bbucklan\100jpl-devvax.jpl.nasa.gov",
a94e4597 56 "ben\100linuxgazette.net",
8513229b 57 "bilbo\100ua.fm",
8b80c7bd 58 "blino\100mandriva.com",
8513229b
A
59 "bob\100starlabs.net",
60 "bonefish\100cs.tu-berlin.de",
61 "bstrand\100switchmanagement.com",
62 "cygwin\100cygwin.com",
63 "david\100dhaller.de",
64 "dformosa\100dformosa.zeta.org.au",
65 "dgay\100acm.org",
66 "erik\100cs.uni-jena.de",
67 "glasser\100tang-eleven-seventy-nine.mit.edu",
68 "gml4410\100ggr.co.uk",
69 "grommel\100sears.com",
8b80c7bd 70 "ilmari\100vesla.ilmari.org",
8513229b
A
71 "ilya\100juil.nonet",
72 "info\100lingo.kiev.ua",
73 "jms\100mathras.comcast.net",
a94e4597 74 "johnh\100isi.edu",
8513229b
A
75 "kan\100dcit.cz",
76 "kaminsky\100math.huji.ac.il",
77 "knew-p5p\100pimb.org",
78 "kvr\100centrum.cz",
a94e4597 79 "lemkemch\100t-online.de",
8513229b
A
80 "mauzo\100csv.warwick.ac.uk",
81 "merijnb\100ms.com",
82 "mlelstv\100serpens.de",
83 "p.boven\100sara.nl",
84 "padre\100elte.hu",
8b80c7bd 85 "pancho\100pancho.name",
8513229b
A
86 "perlbug\100veggiechinese.net",
87 "pm\100capmon.dk",
88 "premchai21\100yahoo.com",
89 "pxm\100nubz.org",
90 "raf\100tradingpost.com.au",
91 "scott\100perlcode.org",
92 "smoketst\100hp46t243.cup.hp.com",
93 "yath-perlbug\100yath.de",
94;
95
96#
97# Email addresses for people that don't have an email address in AUTHORS
98# Presumably deliberately?
99#
100
101$map {$_} = '!' for
cf3e690a
A
102 # Nick Ing-Simmons has passed away (2006-09-25).
103 "nick\100ing-simmons.net",
104 "nik\100tiuk.ti.com",
105 "nick.ing-simmons\100elixent.com",
106
107 # Iain Truskett has passed away (2003-12-29).
8513229b
A
108 "perl\100dellah.anu.edu.au",
109 "spoon\100dellah.org",
110 "spoon\100cpan.org",
111
112 # Ton Hospel
113 "me-02\100ton.iguana.be",
114 "perl-5.8.0\100ton.iguana.be",
115 "perl5-porters\100ton.iguana.be",
116
117 # Beau Cox
118 "beau\100beaucox.com",
119
120 # Randy W. Sims
121 "ml-perl\100thepierianspring.org",
122
123 # Yuval Kogman
124 "nothingmuch\100woobling.org",
125
126;
127
a7ad7795 128
5649b9c9
NC
129if (@authors) {
130 my %raw;
131 foreach my $filename (@authors) {
132 open FH, "<$filename" or die "Can't open $filename: $!";
133 while (<FH>) {
134 next if /^\#/;
135 next if /^-- /;
136 if (/<([^>]+)>/) {
137 # Easy line.
138 $raw{$1}++;
139 } elsif (/^([-A-Za-z0-9 .\'À-ÖØöø-ÿ]+)[\t\n]/) {
140 # Name only
141 $untraced{$1}++;
142 } else {
143 chomp;
144 warn "Can't parse line '$_'";
145 }
146 }
147 }
148 foreach (keys %raw) {
149 print "E-mail $_ occurs $raw{$_} times\n" if $raw{$_} > 1;
150 $_ = lc $_;
151 $authors{$map{$_} || $_}++;
152 }
2b90724c
NC
153 ++$authors{'!'};
154 ++$authors{'?'};
5649b9c9
NC
155}
156
157while (<>) {
158 next if /^-+/;
159 if (m!^\[\s+(\d+)\]\s+By:\s+(\S+)\s+on!) {
160 # new patch
161 my @new = ($1, $2);
162 &process ($committer, $patch, $log);
163 ($patch, $committer) = @new;
164 undef $log;
165 } elsif (s/^(\s+Log: )//) {
166 die "Duplicate Log:" if $log;
167 $log = $_;
168 my $prefix = " " x length $1;
169 LOG: while (<>) {
84fd1186 170 next if /^$/;
bdb5e10e 171 s/^\t/ /;
5649b9c9
NC
172 if (s/^$prefix//) {
173 $log .= $_;
174 } elsif (/^\s+Branch:/) {
175 last LOG;
176 } else {
84fd1186
NC
177 chomp;
178 die "Malformed log end with '$_'";
5649b9c9
NC
179 }
180 }
181 }
182}
183
184&process ($committer, $patch, $log);
185
186if ($rank) {
ff4d71b5
NC
187 &display_ordered(\%patchers);
188} elsif ($ta) {
189 &display_ordered(\%committers);
5649b9c9
NC
190} elsif (%authors) {
191 my %missing;
192 foreach (sort keys %patchers) {
193 next if $authors{$_};
194 # Sort by number of patches, then name.
195 $missing{$patchers{$_}}->{$_}++;
196 }
197 foreach my $patches (sort {$b <=> $a} keys %missing) {
198 print "$patches patch(es)\n";
199 foreach my $author (sort keys %{$missing{$patches}}) {
200 print " $author\n";
201 }
202 }
203}
204
205sub display_ordered {
ff4d71b5 206 my $what = shift;
5649b9c9 207 my @sorted;
15b8f96d 208 my $total;
ff4d71b5 209 while (my ($name, $count) = each %$what) {
5649b9c9 210 push @{$sorted[$count]}, $name;
15b8f96d 211 $total += $count;
5649b9c9
NC
212 }
213
214 my $i = @sorted;
2b0ba25f
NC
215 return unless @sorted;
216 my $sum = 0;
217 foreach my $i ($reverse ? 0 .. $#sorted : reverse 0 .. $#sorted) {
5649b9c9 218 next unless $sorted[$i];
15b8f96d 219 my $prefix;
2b0ba25f
NC
220 $sum += $i * @{$sorted[$i]};
221 # Value to display is either this one, or the cumulative sum.
222 my $value = $cumulative ? $sum : $i;
15b8f96d 223 if ($percentage) {
2b0ba25f 224 $prefix = sprintf "%6.2f:\t", 100 * $value / $total;
15b8f96d 225 } else {
2b0ba25f 226 $prefix = "$value:\t";
15b8f96d
NC
227 }
228 print wrap ($prefix, "\t", join (" ", sort @{$sorted[$i]}), "\n");
5649b9c9
NC
229 }
230}
231
232sub process {
233 my ($committer, $patch, $log) = @_;
234 return unless $committer;
2b90724c 235 my @authors = $log =~ /From:\s+.*?([^"\@ \t\n<>]+\@[^"\@ \t\n<>]+)/gm;
5649b9c9
NC
236
237 if (@authors) {
238 foreach (@authors) {
239 s/^<//;
240 s/>$//;
241 $_ = lc $_;
242 $patchers{$map{$_} || $_}++;
243 }
244 # print "$patch: @authors\n";
ff4d71b5 245 ++$committers{$committer};
5649b9c9
NC
246 } else {
247 # print "$patch: $committer\n";
248 # Not entirely fair as this means that the maint pumpking scores for
249 # everything intergrated that wasn't a third party patch in blead
250 $patchers{$committer}++;
251 }
252}
253
254
8513229b
A
255__DATA__
256
257#
258# List of mappings. First entry the "correct" email address, as appears
259# in the AUTHORS file. Second is any "alias" mapped to it.
260#
261# If the "correct" email address is a '+', the entry above is reused;
262# this for addresses with more than one alias.
263#
264# Note that all entries are in lowercase. Further, no '@' signs should
265# appear; use \100 instead.
266#
267#
268# Committers.
269#
270adi enache\100rdslink.ro
271alanbur alan.burlison\100sun.com
272+ alan.burlison\100uk.sun.com
273ams ams\100wiw.org
274chip chip\100pobox.com
275craigb craig.berry\100psinetcs.com
276+ craig.berry\100metamorgs.com
277+ craig.berry\100signaltreesolutions.com
278+ craigberry\100mac.com
a94e4597 279+ craig.a.berry\100gmail.com
8513229b
A
280davem davem\100fdgroup.com
281+ davem\100iabyn.nospamdeletethisbit.com
a94e4597 282+ davem\100iabyn.com
8513229b
A
283+ davem\100fdgroup.co.uk
284+ davem\100fdisolutions.com
285+ davem\100iabyn.com
286demerphq demerphq\100gmail.com
287+ yves.orton\100de.mci.com
288+ yves.orton\100mciworldcom.de
289doughera doughera\100lafayette.edu
290gbarr gbarr\100pobox.com
291gisle gisle\100activestate.com
292+ gisle\100aas.no
293gsar gsar\100activestate.com
294+ gsar\100cpan.org
295hv hv\100crypt.compulink.co.uk
296+ hv\100crypt.org
297jhi jhi\100iki.fi
298+ jhietaniemi\100gmail.com
299+ jhi\100kosh.hut.fi
300+ jhi\100cc.hut.fi
301+ jarkko.hietaniemi\100nokia.com
302merijn h.m.brand\100xs4all.nl
303+ h.m.brand\100hccnet.nl
304+ merijn\100l1.procura.nl
305mhx mhx-perl\100gmx.net
306nicholas nick\100unfortu.net
307+ nick\100ccl4.org
308+ nick\100talking.bollo.cx
309+ nick\100plum.flirble.org
310+ nick\100babyhippo.co.uk
311+ nick\100bagpuss.unfortu.net
8513229b
A
312pudge pudge\100pobox.com
313rgs rgarciasuarez\100free.fr
314+ rgarciasuarez\100mandrakesoft.com
315+ rgarciasuarez\100mandriva.com
316+ rgarciasuarez\100gmail.com
317+ raphel.garcia-suarez\100hexaflux.com
318sky sky\100nanisky.com
319+ artur\100contiller.se
320+ arthur\100contiller.se
b692cd7a
SH
321steveh stevehay\100planit.com
322+ steve.hay\100uk.radan.com
8513229b
A
323stevep steve\100fisharerojo.org
324+ steve.peters\100gmail.com
325
326#
327# Mere mortals.
328#
8b80c7bd
SH
329\043####\100juerd.nl juerd\100cpan.org
330+ juerd\100convolution.nl
8513229b
A
3317k8lrvf02\100sneakemail.com kjx9zthh3001\100sneakemail.com
332+ dtr8sin02\100sneakemail.com
333+ rt8363b02\100sneakemail.com
334+ o6hhmk002\100sneakemail.com
a94e4597
SM
335+ smueller\100cpan.org
336+ l2ot9pa02\100sneakemail.com
337+ wyp3rlx02\100sneakemail.com
8513229b 338
8b80c7bd 339a.r.ferreira\100gmail.com aferreira\100shopzilla.com
8513229b
A
340abe\100ztreet.demon.nl abeltje\100cpan.org
341abigail\100abigail.be abigail\100foad.org
342+ abigail\100abigail.nl
343ajohnson\100nvidia.com ajohnson\100wischip.com
344alexm\100netli.com alexm\100w-m.ru
a94e4597 345alex-p5p\100earth.li alex\100rcon.rog
8513229b
A
346alian\100cpan.org alian\100alianwebserver.com
347allens\100cpan.org easmith\100beatrice.rutgers.edu
8b80c7bd
SH
348andreas.koenig\100anima.de andreas.koenig.gmwojprw\100franz.ak.mind.de
349+ andreas.koenig.7os6vvqr\100franz.ak.mind.de
8513229b
A
350+ a.koenig\100mind.de
351anno4000\100lublin.zrz.tu-berlin.de anno4000\100mailbox.tu-berlin.de
352+ siegel\100zrz.tu-berlin.de
353ash\100cpan.org ash_cpan\100firemirror.com
354avarab\100gmail.com avar\100cpan.org
355
356bah\100ecnvantage.com bholzman\100longitude.com
8b80c7bd 357bcarter\100gumdrop.flyinganvil.org q.eibcartereio.=~m-b.{6}-cgimosx\100gumdrop.flyinganvil.org
8513229b
A
358ben_tilly\100operamail.com btilly\100gmail.com
359
360chromatic\100wgz.org chromatic\100rmci.net
361clkao\100clkao.org clkao\100bestpractical.com
8b80c7bd 362corion\100corion.net corion\100cpan.org
8513229b
A
363cp\100onsitetech.com publiustemp-p5p\100yahoo.com
364+ publiustemp-p5p3\100yahoo.com
365cpan\100audreyt.org autrijus\100egb.elixus.org
366+ autrijus\100geb.elixus.org
367+ autrijus\100gmail.com
368+ autrijus\100ossf.iis.sinica.edu.tw
369+ autrijus\100autrijus.org
370+ audreyt\100audreyt.org
371
372damian\100cs.monash.edu.au damian\100conway.org
373david.dyck\100fluke.com dcd\100tc.fluke.com
374demerphq\100gmail.com demerphq\100hotmail.com
375domo\100computer.org shouldbedomo\100mac.com
376
377epeschko\100den-mdev1 esp5\100pge.com
378
379fugazi\100zyx.net larrysh\100cpan.org
380
f0cb2104
NC
381jns\100integration-house.com jns\100gellyfish.com
382+ gellyfish\100gellyfish.com
8513229b
A
383gp\100familiehaase.de gerrit\100familiehaase.de
384grazz\100pobox.com grazz\100nyc.rr.com
385
386hio\100ymir.co.jp hio\100hio.jp
387
388japhy\100pobox.com japhy\100pobox.org
389+ japhy\100perlmonk.org
390+ japhy\100cpan.org
391jari.aalto\100poboxes.com jari.aalto\100cante.net
392jcromie\100divsol.com jcromie\100cpan.org
393+ jim.cromie\100gmail.com
394jdhedden\100cpan.org jerry\100hedden.us
395+ jdhedden\1001979.usna.com
396+ jdhedden\100gmail.com
397+ jdhedden\100yahoo.com
398jfriedl\100yahoo.com jfriedl\100yahoo-inc.com
399jjore\100cpan.org twists\100gmail.com
8513229b
A
400
401kane\100dwim.org kane\100xs4all.net
402+ kane\100cpan.org
403+ kane\100xs4all.nl
404+ jos\100dwim.org
405+ jib\100ripe.net
8b80c7bd 406ken\100mathforum.org kenahoo\100gmail.com
8513229b
A
407kroepke\100dolphin-services.de kay\100dolphin-services.de
408kstar\100wolfetech.com kstar\100cpan.org
8b80c7bd 409+ kurt_starsinic\100ml.com
8513229b 410
8b80c7bd 411marcel\100codewerk.com gr\100univie.ac.at
8513229b
A
412mats\100sm6sxl.net mats\100sm5sxl.net
413mbarbon\100dsi.unive.it mattia.barbon\100libero.it
414mcmahon\100ibiblio.org mcmahon\100metalab.unc.edu
415merijnb\100iloquent.nl merijnb\100iloquent.com
416mgjv\100comdyn.com.au mgjv\100tradingpost.com.au
417michael.schroeder\100informatik.uni-erlangen.de mls\100suse.de
418mike\100stok.co.uk mike\100exegenix.com
419mjtg\100cam.ac.uk mjtg\100cus.cam.ac.uk
420
421nospam-abuse\100bloodgate.com tels\100bloodgate.com
422+ perl_dummy\100bloodgate.com
a94e4597
SM
423ilya\100math.berkeley.edu ilya\100math.ohio-state.edu
424+ nospam-abuse\100ilyaz.org
8513229b
A
425
426p5-authors\100crystalflame.net perl\100crystalflame.net
427+ rs\100crystalflame.net
428paul.green\100stratus.com paul_greenvos\100vos.stratus.com
429paul.marquess\100btinternet.com paul_marquess\100yahoo.co.uk
430+ paul.marquess\100ntlworld.com
431+ paul.marquess\100openwave.com
432pcg\100goof.com schmorp\100schmorp.de
8b80c7bd 433perl-rt\100wizbit.be p5p\100perl.wizbit.be
8513229b
A
434# Maybe we should special case this to get real names out?
435perlbug\100perl.org perlbug-followup\100perl.org
436+ bugs-perl5\100bugs6.perl.org
437phil\100perkpartners.com phil\100finchcomputer.com
438pimlott\100idiomtech.com andrew\100pimlott.net
439pne\100cpan.org philip.newton\100gmx.net
440+ philip.newton\100datenrevision.de
441+ pnewton\100gmx.de
442
443radu\100netsoft.ro rgreab\100fx.ro
444richard.foley\100ubsw.com richard.foley\100t-online.de
445+ richard.foley\100ubs.com
446+ richard.foley\100rfi.net
447rick\100consumercontact.com rick\100bort.ca
448+ rick.delaney\100rogers.com
a94e4597 449+ rick\100bort.ca
4bc69901 450rjbs\100cpan.org rjbs-perl-p5p\100lists.manxome.org
8b80c7bd 451+ perl.p5p\100rjbs.manxome.org
8513229b
A
452rjk\100linguist.dartmouth.edu rjk\100linguist.thayer.dartmouth.edu
453+ rjk-perl-p5p\100tamias.net
454rmgiroux\100acm.org rmgiroux\100hotmail.com
a94e4597
SM
455rmbarker\100cpan.org rmb1\100cise.npl.co.uk
456+ robin.barker\100npl.co.uk
8b80c7bd 457robertmay\100cpan.org rob\100themayfamily.me.uk
8513229b
A
458rootbeer\100teleport.com rootbeer\100redcat.com
459
460schubiger\100cpan.org steven\100accognoscere.org
461+ sts\100accognoscere.org
8b80c7bd 462+ schubiger\100gmail.com
8513229b 463schwern\100pobox.com schwern\100gmail.com
8ed05479
MS
464+ schwern\100athens.arena-i.com
465+ schwern\100blackrider.aocn.com
466+ schwern\100ool-18b93024.dyn.optonline.net
8513229b
A
467sebastien\100aperghis.net maddingue\100free.fr
468+ saper\100cpan.org
e853cbad 469shlomif\100vipe.technion.ac.il shlomif\100iglu.org.il
8513229b
A
470simon\100simon-cozens.org simon\100pembro4.pmb.ox.ac.uk
471+ simon\100brecon.co.uk
472+ simon\100othersideofthe.earth.li
473+ simon\100cozens.net
474+ simon\100netthink.co.uk
475slaven\100rezic.de slaven.rezic\100berlin.de
a94e4597 476+ srezic\100iconmobile.com
8b80c7bd 477+ srezic\100cpan.org
8513229b
A
478smcc\100mit.edu smcc\100ocf.berkeley.edu
479+ smcc\100csua.berkeley.edu
480spider\100orb.nashua.nh.us spider\100web.zk3.dec.com
481+ spider\100leggy.zk3.dec.com
482+ spider-perl\100orb.nashua.nh.us
483+ spider\100peano.zk3.dec.com
484stef\100mongueurs.net stef\100payrard.net
485+ s.payrard\100wanadoo.fr
486
487tassilo.parseval\100post.rwth-aachen.de tassilo.von.parseval\100rwth-aachen.de
488thomas.dorner\100start.de tdorner\100amadeus.net
489tjenness\100cpan.org t.jenness\100jach.hawaii.edu
490+ timj\100jach.hawaii.edu
491tom.horsley\100mail.ccur.com tom.horsley\100ccur.com
492
493vkonovalov\100lucent.com vkonovalov\100peterstar.ru
494+ konovalo\100mail.wplus.net
495+ vadim\100vkonovalov.ru
496+ vkonovalov\100spb.lucent.com
497+ vkonovalov\100alcatel-lucent.com
498
499whatever\100davidnicol.com davidnicol\100gmail.com
500wolfgang.laun\100alcatel.at wolfgang.laun\100chello.at
501+ wolfgang.laun\100thalesgroup.com
502+ wolfgang.laun\100gmail.com