3
unless (scalar(@ARGV) == 1)
5
die "Usage: check_licenses directory";
8
my $gpl = 'General Public License';
9
my $gp2 = 'This is free software; it comes under the GNU';
10
my $gp3 = 'License: GPL with the following explicit clarification';
11
my $x11 = 'TORT OR OTHERWISE';
12
my $bsd = 'INCLUDING NEGLIGENCE OR OTHERWISE';
13
my $gen = 'generated';
19
if ($f =~ /\.C$/ or $f =~ /\.cpp$/ or $f =~ /\.c$/ or $f =~ /\.h$/)
25
$f !~ /meta_unload\.cpp$/
26
and $f !~ /_stub\.cpp/
28
and $f !~ /_closure\.cpp/
54
opendir (DIR, $dir) or die "Can't open $dir";
56
my @filenames = grep { /^[^\.]/ } readdir(DIR);
58
for my $f (@filenames)
60
my $filename = "$dir/$f";
64
&recursive_check($filename);
66
elsif (-f $filename and &nameok($filename))
68
open (IN, "<$filename") or die "Can't open $filename";
74
if (/$gpl/) { $license = "G"; last; }
75
if (/$gp2/) { $license = "G"; last; }
76
if (/$gp3/) { $license = "G"; last; }
77
if (/$x11/) { $license = "X"; last; }
78
if (/$bsd/) { $license = "B"; last; }
79
if (/$gen/) { $license = "g"; last; }
82
print "$license $filename\n";
87
&recursive_check($ARGV[0]);