2002-12-18 08:33:21 +00:00
|
|
|
#!/usr/bin/perl -w
|
2004-11-04 22:56:36 +00:00
|
|
|
# ***********************************************************************
|
2002-12-18 08:33:21 +00:00
|
|
|
# * COPYRIGHT:
|
2005-04-25 23:47:25 +00:00
|
|
|
# * Copyright (c) 2002-2005, International Business Machines Corporation
|
2004-11-04 22:56:36 +00:00
|
|
|
# * and others. All Rights Reserved.
|
|
|
|
# ***********************************************************************
|
2005-04-25 23:47:25 +00:00
|
|
|
#
|
|
|
|
# Search for files modified this year, that need to have copyright indicating
|
|
|
|
# this current year on them.
|
|
|
|
#
|
2002-12-18 08:33:21 +00:00
|
|
|
use strict;
|
|
|
|
|
2003-12-19 23:30:30 +00:00
|
|
|
my $icuSource = $ARGV[0];
|
2004-11-04 22:56:36 +00:00
|
|
|
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";
|
2002-12-18 08:33:21 +00:00
|
|
|
|
2003-12-19 23:30:30 +00:00
|
|
|
my ($sec, $min, $hour, , $day, $mon, $year, $wday, $yday, $isdst) = localtime;
|
|
|
|
$year += 1900;
|
|
|
|
|
2004-11-04 22:56:36 +00:00
|
|
|
my $command = "find $icuSource -type f -mtime -$yday | fgrep -v -f cpyskip.txt";
|
2002-12-18 08:33:21 +00:00
|
|
|
my @files = `$command`;
|
|
|
|
@files = grep(!/$ignore/, @files);
|
|
|
|
my $file;
|
|
|
|
foreach $file (@files) {
|
2004-05-18 22:01:41 +00:00
|
|
|
chomp $file;
|
2004-11-01 23:36:49 +00:00
|
|
|
my @lines = `head -n 20 "$file"`;
|
2003-12-19 23:30:30 +00:00
|
|
|
if (grep(/copyright.*$year/i, @lines) == 0) {
|
2004-05-18 22:01:41 +00:00
|
|
|
print "$file\n";
|
2002-12-18 08:33:21 +00:00
|
|
|
}
|
|
|
|
}
|