Clean up the code so that it's at least usable in the future.
This commit was SVN r8000.
Этот коммит содержится в:
родитель
42ec26e640
Коммит
00e7963c67
@ -81,17 +81,6 @@ sub wanted {
|
||||
1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $new_iu1 = "Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana";
|
||||
my $new_iu2 = "University Research and Technology";
|
||||
my $new_iu3 = "Corporation. All rights reserved.";
|
||||
|
||||
my $new_utk1 = "Copyright (c) 2004-2005 The University of Tennessee and The University";
|
||||
my $new_utk2 = "of Tennessee Research Foundation. All rights";
|
||||
my $new_utk3 = "reserved.";
|
||||
|
||||
|
||||
find (\&wanted, ".");
|
||||
my $counts;
|
||||
my $max_count = -1;
|
||||
@ -101,16 +90,33 @@ foreach my $file (sort keys %files_found) {
|
||||
close(FILE);
|
||||
if ($#found >= 0) {
|
||||
print "Found file: $file\n";
|
||||
|
||||
# Added to fix IU/UTK copyrights, 5/Nov/2005
|
||||
if (1) {
|
||||
fix_iu_utk_copyright($file);
|
||||
} else {
|
||||
add_copyright($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
my $new_iu1 = "Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana";
|
||||
my $new_iu2 = "University Research and Technology";
|
||||
my $new_iu3 = "Corporation. All rights reserved.";
|
||||
|
||||
my $new_utk1 = "Copyright (c) 2004-2005 The University of Tennessee and The University";
|
||||
my $new_utk2 = "of Tennessee Research Foundation. All rights";
|
||||
my $new_utk3 = "reserved.";
|
||||
|
||||
sub fix_iu_utk_copyright {
|
||||
my ($file) = @_;
|
||||
|
||||
open FILE, $file;
|
||||
my @lines = <FILE>;
|
||||
close FILE;
|
||||
|
||||
#my $old_iu1 = "Copyright \(c\) 2004-2005 The Trustees of Indiana University\.";
|
||||
#my $old_iu2 = "All rights reserved.";
|
||||
|
||||
#my $old_utk1 = "Copyright (c) 2004-2005 The Trustees of the University of Tennessee.";
|
||||
#my $old_utk2 = "All rights reserved.";
|
||||
|
||||
my $text = join('', @lines);
|
||||
$text =~ s/([ \*\!\#\%\/dnl]*)Copyright \(c\) 2004-2005 The Trustees of Indiana University\.\n([ \*\!\#\%\/dnl]*)All rights reserved\.\n/$1$new_iu1\n$2$new_iu2\n$2$new_iu3\n/;
|
||||
$text =~ s/([ \*\!\#\%\/dnl]*)Copyright \(c\) 2004-2005 The Trustees of the University of Tennessee\.\n([ \*\!\#\%\/dnl]*)All rights reserved\.\n/$1$new_utk1\n$2$new_utk2\n$2$new_utk3\n/;
|
||||
@ -121,8 +127,14 @@ foreach my $file (sort keys %files_found) {
|
||||
|
||||
system("cp $file.new $file");
|
||||
unlink("$file.new");
|
||||
}
|
||||
|
||||
if (0) {
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
sub add_copyright {
|
||||
my ($file) = @_;
|
||||
|
||||
open FILE, $file;
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
my $line = $_;
|
||||
@ -145,5 +157,3 @@ foreach my $file (sort keys %files_found) {
|
||||
system("cp $file.new $file");
|
||||
unlink("$file.new");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user