]> git.saurik.com Git - apple/icu.git/blob - icuSources/tools/cpysearch/cpysearch.pl
ICU-8.11.1.tar.gz
[apple/icu.git] / icuSources / tools / cpysearch / cpysearch.pl
1 #!/usr/bin/perl -w
2 # ***********************************************************************
3 # * COPYRIGHT:
4 # * Copyright (c) 2002-2005, International Business Machines Corporation
5 # * and others. All Rights Reserved.
6 # ***********************************************************************
7 #
8 # Search for files modified this year, that need to have copyright indicating
9 # this current year on them.
10 #
11 use strict;
12
13 my $icuSource = $ARGV[0];
14 my $ignore = "CVS|\\~|\\#|Debug|Release|\\.dll|\\.ilk|\\.idb|\\.pdb|\\.dsp|\\.dsw|\\.opt|\\.ncb|\\.vcproj|\\.sln|\\.suo|\\.cvsignore|\\.cnv|\\.res|\\.icu|\\.exe|\\.obj|\\.bin|\\.exp|\\.lib|\\.out|\\.plg|positions|unidata|\\.jar|\\.spp|\\.stub|\\.policy";
15
16 my ($sec, $min, $hour, , $day, $mon, $year, $wday, $yday, $isdst) = localtime;
17 $year += 1900;
18
19 my $command = "find $icuSource -type f -mtime -$yday | fgrep -v -f cpyskip.txt";
20 my @files = `$command`;
21 @files = grep(!/$ignore/, @files);
22 my $file;
23 foreach $file (@files) {
24 chomp $file;
25 my @lines = `head -n 20 "$file"`;
26 if (grep(/copyright.*$year/i, @lines) == 0) {
27 print "$file\n";
28 }
29 }