File: make_authors

package info (click to toggle)
wine 0.0.20000109-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 22,652 kB
  • ctags: 59,973
  • sloc: ansic: 342,054; perl: 3,697; yacc: 3,059; tcl: 2,647; makefile: 2,466; lex: 1,494; sh: 394
file content (58 lines) | stat: -rwxr-xr-x 1,152 bytes parent folder | download
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
#! /usr/bin/perl
#
# Generate AUTHORS and include/authors.h
#
open(AUTHORS,"<AUTHORS") or die "Can't open AUTHORS";
open(NEWAUTHORS,">AUTHORS.new");
while(<AUTHORS>)
  {
    print NEWAUTHORS;
    last if /^Wine is/;
  }
while(<AUTHORS>)
  {
    chop;
    s/^and //;
    s/[,.]$//;
    push @authors, $_;
  }

# Sort them
sub cmpnames
  {
    @anames = split(" ",$a);
    @bnames = split(" ",$b);
    $ret = $anames[-1] cmp $bnames[-1];
    $ret = $anames[0] cmp $bnames[0] unless $ret;
    return $ret;
  }
@authors = sort cmpnames @authors;

# Print authors
for ($i = 0; $i < $#authors; $i++)
  {
    print NEWAUTHORS "$authors[$i],\n";
  }
print NEWAUTHORS "and $authors[$#authors].\n";
print "Created AUTHORS.new\n";

# Build authors.h file
open(NEWAUTHORS_H,">include/authors.h");

print NEWAUTHORS_H <<EOF;
#ifndef __WINE_AUTHORS_H
#define __WINE_AUTHORS_H

static const char * const SHELL_People[] =
{
EOF

# Print authors
for ($i = 0; $i <= $#authors; $i++)
  {
    print NEWAUTHORS_H "    \"$authors[$i]\",\n";
  }
print NEWAUTHORS_H "    0\n};\n";
print NEWAUTHORS_H "\n#endif  /* __WINE_AUTHORS_H */\n";

print "Created include/authors.h\n";