Changeset f5e593b3a2875895dd7e3f4489b4435f7712c831 for buildtools
- Timestamp:
- 05/14/09 14:12:39 (4 years ago)
- git-parent:
- Files:
-
- buildtools/license-audit (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
buildtools/license-audit
r88a7178 rf5e593b 1 1 #!/usr/bin/perl 2 2 3 use Getopt::Long; 3 4 use File::Find; 4 5 use strict; 6 7 my $include_re = undef; 8 my $exclude_re = undef; 9 10 GetOptions("i=s" => \$include_re, 11 "x=s" => \$exclude_re); 12 die "-i or -x, not both\n", if(defined($include_re) && defined($exclude_re)); 13 $exclude_re = qr/$exclude_re/ if defined($exclude_re); 14 $include_re ||= 'unknown' unless defined($exclude_re); 15 $include_re = qr/$include_re/ if defined($include_re); 5 16 6 17 my %licenses = ( … … 220 231 if($fname =~ /\.(?:c|h|java|cpp|hpp|C|s|lua)$/) { 221 232 my $license = detect_license($fname); 222 print "$fname -> ($license)\n"; 233 if(($include_re && $license =~ $include_re) || 234 ($exclude_re && $license !~ $exclude_re)) { 235 print "$fname -> ($license)\n"; 236 } 223 237 } 224 238 return 1;
