blob: eeaba02b5683e5714c0fb2d2844e5e413c7ad6bf [file] [log] [blame]
Francois Gouget0218e0a2004-10-21 19:58:25 +00001#! /usr/bin/perl -w
Alexandre Julliard77977231998-12-10 09:35:50 +00002#
Alexandre Julliard129f1e62003-11-18 19:50:24 +00003# Generate AUTHORS
Alexandre Julliard77977231998-12-10 09:35:50 +00004#
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00005# Copyright 1998 Alexandre Julliard
6#
7# This library is free software; you can redistribute it and/or
8# modify it under the terms of the GNU Lesser General Public
9# License as published by the Free Software Foundation; either
10# version 2.1 of the License, or (at your option) any later version.
11#
12# This library is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# Lesser General Public License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public
18# License along with this library; if not, write to the Free Software
Jonathan Ernst360a3f92006-05-18 14:49:52 +020019# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000020#
Francois Gouget0218e0a2004-10-21 19:58:25 +000021use strict;
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000022
Francois Gouget0218e0a2004-10-21 19:58:25 +000023my @authors;
Alexandre Julliard77977231998-12-10 09:35:50 +000024open(AUTHORS,"<AUTHORS") or die "Can't open AUTHORS";
Colin Pitratab2cdea2006-08-08 12:19:31 +020025open(NEWAUTHORS,">AUTHORS.new") or die "Can't open AUTHORS.new";
Alexandre Julliard77977231998-12-10 09:35:50 +000026while(<AUTHORS>)
27 {
28 print NEWAUTHORS;
Alexandre Julliard129f1e62003-11-18 19:50:24 +000029 last if /^$/;
Alexandre Julliard77977231998-12-10 09:35:50 +000030 }
31while(<AUTHORS>)
32 {
33 chop;
Alexandre Julliard77977231998-12-10 09:35:50 +000034 push @authors, $_;
35 }
36
37# Sort them
Francois Gouget0218e0a2004-10-21 19:58:25 +000038sub cmpnames()
Alexandre Julliard77977231998-12-10 09:35:50 +000039 {
Francois Gouget0218e0a2004-10-21 19:58:25 +000040 my @anames = split(" ",$a);
41 my @bnames = split(" ",$b);
42 my $ret;
Alexandre Julliard77977231998-12-10 09:35:50 +000043 $ret = $anames[-1] cmp $bnames[-1];
44 $ret = $anames[0] cmp $bnames[0] unless $ret;
45 return $ret;
46 }
47@authors = sort cmpnames @authors;
48
49# Print authors
Alexandre Julliard129f1e62003-11-18 19:50:24 +000050print NEWAUTHORS (join "\n", @authors) . "\n";
Alexandre Julliard77977231998-12-10 09:35:50 +000051print "Created AUTHORS.new\n";