summaryrefslogtreecommitdiff
path: root/check-THANKS.pl
blob: d2389b33a08a075c7663091853c3bd3190857aba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-

#
#  Nautilus
#
#  Copyright (C) 2000, 2001 Eazel, Inc.
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation; either version 2 of the
#  License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this library; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#  Author: Maciej Stachowiak <mjs@eazel.com>
#

# check-THANKS.pl: Checks for users mentioned in one of the ChangeLogs
# but not in THANKS or AUTHORS; ensure that THANKS and AUTHORS do not
# overlap.

use diagnostics;
use strict;

# Map from alternate names of some users to canonical versions

my %name_map =
  (
   "T???=82??=B5ivo Leedj???=A2??=82??=ACrv" => "Tõivo Leedjärv",
   "Tõivo Leedjärv" => "Tõivo Leedjärv",
   "Sanlig adral" => "Sanlig Badral",
   "Rahul Balerao" => "Rahul Bhalerao",
   "Richard Hestilow" => "Rachel Hestilow",
   "Martin Norback" => "Martin Norbäck",
   "Martin Norb??ck" => "Martin Norbäck",
   "Josep Puigdemont" => "Josep Puigdemont Casamajó",
   "Josep Puigdemont i Casamajó" => "Josep Puigdemont Casamajó",
   "?smund Skj?veland" => "Åsmund Skjæveland",
   "Alexander Larsson" => "Alex Larsson",
   "?ygimantas Beru?ka" => "Žygimantas Beručka",
   "Beru?ka" => "Beručka",
   "Carlos Perell?? Mar??n" => "Carlos Perelló Marín",
   "Carlos Perello Marin" => "Carlos Perelló Marín",
   "Carlos Perelló Marín" => "Carlos Perelló Marín",
   "Ch4ristian Rose" => "Christian Rose",
   "Danilo ? egan" => "Danilo Šegan",
   "Danilo ?egan" => "Danilo Šegan",
   "Danilo Å egan" => "Danilo Šegan",
   "Darin as Andy" => "Darin Adler",
   "Diego Gonzalez Gonzalez" => "Diego Gonzalez",
   "Diego González" => "Diego Gonzalez",
   "Eskil Olsen" => "Eskil Heyn Olsen",
   "Gustavo Giráldez" => "Gustavo Giráldez",
   "I?aki Larra?aga" => "Inaki Larranaga Murgoitio",
   "Inaki Laranaga Murgoitio" => "Inaki Larranaga Murgoitio",
   "Inaki Larranaga" => "Inaki Larranaga Murgoitio",
   "J. Shane Culpepper" => "J Shane Culpepper",
   "Jesus Bravo Alvarez" => "Jesús Bravo Álvarez",
   "M?tin ?mirov" => "Mətin Əmirov",
   "Michael Engber" => "Mike Engber",
   "Michael K. Fleming" => "Mike Fleming",
   "Pavel Císler" => "Pavel Cisler",
   "Pavel" => "Pavel Cisler",
   "Rebecka Schulman" => "Rebecca Schulman",
   "Robin Slomkowski" => "Robin * Slomkowski",
   "Shane Culpepper" => "J Shane Culpepper",
   "Szabolcs BAN" => "Szabolcs Ban",
   "Takuo KITAME" => "Takuo Kitame",
   "Matic Zgur" => "Matic Žgur",
   "Nelson Benitez" => "Nelson Benítez",
   "arik devens" => "Arik Devens",
   "Samúel Jón Gunnarsson" => "Samuel Jan Gunnarsson",
   "Sam?=BAel J?=B3n Gunnarsson" => "Samuel Jan Gunnarsson",
   "Sam?el J?n Gunnarsson" => "Samuel Jan Gunnarsson",
   "Soeren Sandmann Pedersen" => "Soeren Sandmann",
   "Soren Sandmann" => "Soeren Sandmann",
   "Takeshi AiHANA" => "Takeshi AIHANA",
   "Miguel Rodríguez Pérez" => "Rodriguez Perez"
  );

# Map from alternate email addresses of some users to canonical versions

my %email_map =
  (
   'uws+gnome@xs4all.nl' => 'wbolster@gnome.org',
   'wbolster@cvs.gnome.org' => 'wbolster@gnome.org',
   'wbolster@svn.gnome.org' => 'wbolster@gnome.org',
   'randrianiriana@gmaial.com' => 'thierryr@svn.gnome.org',
   'thierry@randrianiriana.org' => 'thierryr@svn.gnome.org',
   'thierryR@svn.gnome.org' => 'thierryr@svn.gnome.org',
   'aihana@gnome.gr.jp' => 'takeshi.aihana@gmail.com',
   'takehsi.aihana@gmail.com' => 'takeshi.aihana@gmail.com',
   'sunil@atc.tcs.com' => 'sunilmohan@fsf.org.in',
   'sunil@atc.tcs.co.in' => 'sunilmohan@fsf.org.in',
   'ssp@localhost.localdomain' => 'sandmann@redhat.com',
   'rozobeh@sharif.edu' => 'roozbeh@farsiweb.info',
   'runa@bengalinux.org' => 'runabh@gmail.com',
   'rajeshkajha@yahoo.com' => 'rranjan@redhat.com',
   'amd@store20.com' => 'plaes@svn.gnome.org',
   'gforcada@svn.gnome.org' => 'gforcada@gnome.org',
   'bpepple@fedoraproject.org' => 'bdpepple@gmail.com',
   'yaihr@gmail.com' => 'yairhr@gmail.com',
   'chyla@buy.pl' => 'chyla@gnome.pl',
   'mail@zbigniew.chyla.pl' => 'chyla@gnome.pl',
   'uid0@tuxfamily.org' => 'zygis@gnome.org',
   'uid0@akl.lt' => 'zygis@gnome.org',
   'sandmann@daimi.au.dk' => 'sandmann@redhat.com',
   'badral@chinggis.com' => 'Badral@openmn.org',
   'badral@users.sf.net' => 'Badral@openmn.org',
   'badral@chinggis.com' => 'Badral@openmn.org',
   'ptvirtan@cc.hut.fi' => 'pauli.virtanen@hut.fi',
   'pauli.virtanen@saunalahti.fi' => 'pauli.virtanen@hut.fi',
   'frolix68@yahoo.gr' => 'nikosx@gmail.com',
   'mdamt@mnots.eu' => 'mdamt@gnome.org',
   'mvd@mylinux.ua' => 'dziumanenko@gmail.com',
   'martin.wehner@epost.de' => 'martin.wehner@gmail.com',
   'josep@imatge-sintetica.com' => 'josep.puigdemont@gmail.com',
   'laca@ireland.sun.com' => 'laca@sun.com',
   'Louise.Miller@ireland.sun.com' => 'louise.miller@sun.com',
   'dooteo@zundan.com' => 'dooteo@euskalgnu.org',
   'doteo@euskalgnu.org' => 'dooteo@euskalgnu.org',
   'ihar.hrachyshka@gmail.com' => 'booxter@lacinka.org',
   'iharh@gnome.org' => 'booxter@lacinka.org',
   'ifelix@svn.gnome.org' => 'ifelix25@gmail.com',
   'hendi@gnome-de.org' => 'hendrikr@gnome.org',
   'dave@ximian.com' => 'dave@novell.com',
   'dcamp@novell.com' => 'dave@novell.com',
   'davidz@redhat.com' => 'david@fubar.dk',
   'dggonz@yahoo.com' => 'diego@pemas.net',
   'cyphra@nano.tecknolabs.com' => 'serrador@openshine.com',
   'dsegan@gmx.net' => 'danilo@gnome.org',
   'cosimoc@svn.gnome.org' => 'cosimoc@gnome.org',
   'chpe@cvs.gnome.org' => 'chpe@gnome.org',
   'chpe@svn.gnome.org' => 'chpe@gnome.org',
   'aflinta@svn.gnome.org' => 'aflinta@gmail.com',
   'peter.ani@hotmail.com' => 'peter.ani@gmail.com',
   'abel@oaka.org' => 'abelcheung@gmail.com',
   'maddog@linux.org.hk' => 'abelcheung@gmail.com',
   'alla@lysator.liu.se' => 'alexl@redhat.com',
   'almer1@dds.nl' => 'almer@gnome.org',
   'andersca@codefactory.se' => 'andersca@gnome.org',
   'andersca@gnu.org' => 'andersca@gnome.org',
   'andy@eazel.com' => 'andy@differnet.com',
   'arik@gnome.org' => 'arik@eazel.com',
   'at@ue-spacy.com' => 'tagoh@gnome.gr.jp',
   'baulig@suse.de' => 'martin@home-of-linux.org',
   'car0969@gamma2.uta.edu' => 'bratsche@gnome.org',
   'carlos@gnome-db.org' => 'carlos@hispalinux.es',
   'cgabriel@softwarelibero.org' => 'cgabriel@cgabriel.org',
   'chief_wanker@eazel.com' => 'eskil@eazel.com',
   'darin@eazel.com' => 'darin@bentspoon.com',
   'dan@eazel.com' => 'd-mueth@uchicago.edu',
   'hp@pobox.com' => 'hp@redhat.com',
   'josh@eazel.com' => 'josh@whitecape.org',
   'jrb@webwynk.net' => 'jrb@redhat.com',
   'jsh@eazel.com' => 'jsh@pixelslut.com',
   'kabalak@gmx.net' => 'kabalak@kabalak.net',
   'kabalak@gtranslator.org' => 'kabalak@kabalak.net',
   'kmaraas@gnu.org' => 'kmaraas@gnome.org',
   'kmaraas@online.no' => 'kmaraas@gnome.org',
   'linux@chrisime.de' => 'chrisime@gnome.org',
   'linuxfan@ionet..net' => 'josh@whitecape.org',
   'linuxfan@ionet.net' => 'josh@whitecape.org',
   'mathieu@gnome.org' => 'mathieu@eazel.com',
   'mathieu@gnu.org' => 'mathieu@eazel.com',
   'mawa@iname.com' => 'mawarkus@gnome.org',
   'mjs@eazel.com' => 'mjs@noisehavoc.org',
   'ramiro@eazel.com' => 'ramiro@fateware.com',
   'raph@gimp.org' => 'raph@acm.org',
   'rslomkow@rslomkow.org' => 'rslomkow@eazel.com',
   'seth@eazel.com' => 'snickell@stanford.edu',
   'sopwith@eazel.com' => 'sopwith@redhat.com',
   'yakk@yakk.net' => 'ian@eazel.com',
   'yakk@yakk.net.au' => 'ian@eazel.com',
   'alexl@cgf.boston.redhat.com' => 'alexl@redhat.com',
   'alexl@redhat.co,' => 'alexl@redhat.com',
   'alexl@redhat' => 'alexl@redhat.com'
  );


# Some ChangeLog lines that carry no credit (incorrect changes that
# had to be reverted, changes done for someone else, etc.)

my %no_credit =
  (
   '2000-09-08  Daniel Egger  <egger@suse.de>' => 1,
   '2000-09-06  Daniel Egger  <egger@suse.de>' => 1,
   '2001-04-25  Changwoo Ryu  <cwryu@debian.org>' => 1,
  );


open CHANGELOGS, "cat `find . -name intl -prune -or -name 'ChangeLog*' -and \! -name '*~' -print`|" or die;

my @lines;
while (<CHANGELOGS>)
  {
    chomp;
    
    if (/@/)
      {
        next if $no_credit{$_};

        if (/^\d\d\d\d-\d\d-\d\d/)
          {
            # Normal style ChangeLog comment 
            s/^\d\d\d\d-\d\d-\d\d[ \t]*//;
          }
        elsif (/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\d\d\d\d/)
          {
            # Old style ChangeLog comment 
            s/^.*20\d\d\s*//;
          }
        elsif (/^\s+Patch from.+<\S+\@\S+>/i)
          {
            # Body of comment says 'Patch from', followed by name and email.
	    s/^\s+Patch from:?\s+//i;
          }
        else
          {
            next; # ignore unknown lines for now
          }
        
        my $name = $_;
        
        $name =~ s/[ \t]*<.*[\n\r]*$//;
        
        $name = $name_map{$name} if $name_map{$name};
        
        my $email = $_;
        
        $email =~ s/^.*<//;
        $email =~ s/>.*$//;
        $email =~ s/[ \t\n\r]*$//;
	$email =~ s/helixcode/ximian/;
        
        $email = $email_map{$email} if $email_map{$email};

        push @lines, "${name}  <${email}>";
    }
}

close CHANGELOGS;

my @changelog_people;
my $last_line = "";
foreach my $line (sort @lines)
  {
    push @changelog_people, $line unless $line eq $last_line;
    $last_line = $line;
  }

open AUTHORS, "AUTHORS" or die;

my @authors;

while (<AUTHORS>) {
    chomp;
    push @authors, $_;
}

close AUTHORS;

open THANKS, "THANKS" or die;

my @thanks_people;
my @non_translation_thanks_people;
my $in_translations = 0;

while (<THANKS>) {
    chomp;
    s/ - .*$//;
    push @thanks_people, $_;
    $in_translations = 1 if /contributed translations/;
    push @non_translation_thanks_people, $_ if !$in_translations;
}

close THANKS;

my $found_about_authors = 0;
my @about_authors;

if (open ABOUT, "src/nautilus-window-menus.c")
  {
    while (<ABOUT>)
      {
        if (/const char \*authors/)
          {
            $found_about_authors = 1;
            last;
          }
      }
    
    if ($found_about_authors)
      {
        while (<ABOUT>)
          {
            last unless /^\s+\"(.*)\",\s*\n/;
            push @about_authors, $1;
          }
      }
    
    close ABOUT;
}

my @uncredited;
foreach my $person (@changelog_people)
  {
    if (! (grep {$_ eq $person} @thanks_people) &&
        ! (grep {$_ eq $person} @authors))
      {
        push @uncredited, $person;
      }
  }

my @double_credited;
foreach my $person (@authors)
  {
    if (grep {$_ eq $person} @non_translation_thanks_people)
      {
        push @double_credited, $person;
      }
  }

my @author_names;
foreach my $person (@authors)
  {
    $person =~ s/\s*<.*//;
    push @author_names, $person;
  }

my @not_in_about;
foreach my $person (@author_names)
  {
    push @not_in_about, $person unless grep {$_ eq $person} @about_authors;
  }

my @only_in_about;
foreach my $person (@about_authors)
  {
    push @only_in_about, $person unless grep {$_ eq $person} @author_names;
  }

my $printed = 0;

if (@uncredited)
  {
    print "\nThe following people are in the ChangeLog but not credited in THANKS or AUTHORS:\n\n";
    
    foreach my $person (@uncredited)
      {
        print "${person}\n";
      }
    
    $printed = 1;
  }

if (@double_credited)
  {
    print "\nThe following people are listed in both THANKS and AUTHORS:\n\n";
    
    foreach my $person (@double_credited)
      {
        print "${person}\n";
      }
    
    $printed = 1;
  } else {

    if (!$found_about_authors)
      {
        print "\nDidn't find authors section in nautilus-window-menus.c\n";
        $printed = 1;
      }
      
    if (@not_in_about)
      {
        print "\nThe following people are in AUTHORS but not the about screen:\n\n";
        
        foreach my $person (@not_in_about)
          {
            print "${person}\n";
          }
        
        $printed = 1;
      }

    if (@only_in_about)
      {
        print "\nThe following people are in the about screen but not AUTHORS:\n\n";
        
        foreach my $person (@only_in_about)
          {
            print "${person}\n";
          }
        
        $printed = 1;
      }
  }


print "\n" if $printed;