2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003 The GemRB Project
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 my $TGT_DIR = "gemrb";
25 # TODO: use list of exceptions, i.e. pairs file, boilerplate to use
29 my $copyright_cpp = <<EOT;
30 /\\* GemRB \\- Infinity Engine Emulator
31 \\* Copyright \\(C\\) 2003 The GemRB Project
33 \\* This program is free software; you can redistribute it and/or
34 \\* modify it under the terms of the GNU General Public License
35 \\* as published by the Free Software Foundation; either version 2
36 \\* of the License, or \\(at your option\\) any later version\\.
38 \\* This program is distributed in the hope that it will be useful,
39 \\* but WITHOUT ANY WARRANTY; without even the implied warranty of
40 \\* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\. See the
41 \\* GNU General Public License for more details\\.
43 \\* You should have received a copy of the GNU General Public License
44 \\* along with this program; if not, write to the Free Software
45 \\* Foundation, Inc\\., 51 Franklin Street, Fifth Floor, Boston, MA 02110\\-1301, USA\\.
54 \\* \@author The GemRB Project
58 my $copyright_py = <<EOT;
59 # \\-\\*\\-python\\-\\*\\-
60 # GemRB \\- Infinity Engine Emulator
61 # Copyright \\(C\\) 2003 The GemRB Project
63 # This program is free software; you can redistribute it and/or
64 # modify it under the terms of the GNU General Public License
65 # as published by the Free Software Foundation; either version 2
66 # of the License, or \\(at your option\\) any later version\\.
68 # This program is distributed in the hope that it will be useful,
69 # but WITHOUT ANY WARRANTY; without even the implied warranty of
70 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\. See the
71 # GNU General Public License for more details\\.
73 # You should have received a copy of the GNU General Public License
74 # along with this program; if not, write to the Free Software
75 # Foundation, Inc\\., 51 Franklin Street, Fifth Floor, Boston, MA 02110\\-1301, USA\\.
82 my @copyright_cpp = split (/\n/, $copyright_cpp);
83 my @copyright_py = split (/\n/, $copyright_py);
88 [ '\\.(pyc|lo)$', 'ignore'],
89 [ '\\.(h|cpp)$', \
@copyright_cpp ],
90 [ '\\.py$', \
@copyright_py ],
97 foreach my $rec (@filetypes) {
99 if ($filename =~ /$re/) {
109 my $copyright = &get_filetype
($filename);
110 if (! defined ($copyright)) {
111 print "? $filename\n";
115 if ($copyright eq 'ignore') {
119 my $num_lines = scalar (@
{$copyright});
122 open (SRC
, "< $filename") || die "Can't open file $filename: $!\n";
125 while (defined (my $line = <SRC
>) && ($index < $num_lines)) {
127 my $cline = $$copyright[$index];
128 if ($line !~ /^$cline$/) {
130 print "! $filename\n";
131 print " -: $cline\n";
139 if ($index >= $num_lines) {
140 print "= $filename\n";
150 opendir (DIR
, $dir) || die "Can't open dir $dir: $!\n";
151 while (defined (my $file = readdir (DIR
))) {
152 my $dirfile = "$dir/$file";
154 &check_file
($dirfile);
155 } elsif (-d
$dirfile && substr($file, 0, 1) ne '.') {
156 &check_dir
($dirfile);
163 if (scalar (@ARGV) != 0) {
167 &check_dir
($TGT_DIR);