diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-03-27 23:09:52 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-03-28 02:47:55 +0000 |
commit | ea062976b8d6421a09afde16fb8ec6174f61cb60 (patch) | |
tree | fbca46b1fce5436405ab1c47e9a7389f9c8e0378 /tools | |
parent | 99878b6cfedd62c3053da0d83812f82734d6a3d1 (diff) |
tools/generate_authors.pl: avoid duplicates
Officially, the local part of an email address is case sensitive, but in
practice this is ignored. Ensure that duplicate email addresses are not
listed.
While at it, detect duplicates using `grep -Po '<\K[^>]+' AUTHORS |
tr '[:upper:]' '[:lower:]' | sort | uniq -cd` and resolve them.
Change-Id: Ie1e853d6253758c8454d9583f0a11f317c8390cb
Reviewed-on: https://code.wireshark.org/review/14659
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/generate_authors.pl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/generate_authors.pl b/tools/generate_authors.pl index 00f7a2f769..187abf670f 100755 --- a/tools/generate_authors.pl +++ b/tools/generate_authors.pl @@ -1,10 +1,5 @@ #!/usr/bin/perl -my $debug = 0; -# 0: off -# 1: specific debug -# 2: full debug - # # Generate the AUTHORS file combining existing AUTHORS file with # git commit log. @@ -103,11 +98,13 @@ sub trim($) sub parse_author_name { my $full_name = $_[0]; + my $email_key; if ($full_name =~ /^([\w\.\-\'\x80-\xff]+(\s*[\w+\.\-\'\x80-\xff])*)\s+<([^>]*)>/) { #Make an exception for Gerald because he's part of the header if ($3 ne "gerald[AT]wireshark.org") { - $contributors{$3} = $1; + $email_key = lc($3); + $contributors{$email_key} = $1; print encode('UTF-8', "$full_name\n"); } } elsif ($full_name =~ /^([\w\.\-\'\x80-\xff]+(\s*[\w+\.\-\'\x80-\xff])*)\s+\(/) { @@ -120,6 +117,7 @@ sub parse_git_name { my $full_name = $_[0]; my $name; my $email; + my $email_key; my $len; my $ntab = 3; my $line; @@ -130,8 +128,9 @@ sub parse_git_name { #Convert real email address to "spam proof" one $email = trim($2); $email =~ s/@/[AT]/g; + $email_key = lc($email); - if (!exists($contributors{ $email })) { + if (!exists($contributors{ $email_key })) { #Make an exception for Gerald because he's part of the header if ($email ne "gerald[AT]wireshark.org") { $len = length $name; @@ -142,6 +141,7 @@ sub parse_git_name { $ntab +=1 if ($len % 8); $line = $name . "\t" x $ntab . "<$email>"; } + $contributors{$email_key} = $1; print encode('UTF-8', "$line\n"); } } |