-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFixHeaders.pl
executable file
·63 lines (54 loc) · 1.98 KB
/
FixHeaders.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/perl
use warnings;
use strict;
my $header = q{
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
M Roberts (original release)
Robin Birch <[email protected]>
Samuel Gisiger <[email protected]>
Jeff Goodenough <[email protected]>
Alastair Harrison <[email protected]>
Scott Penrose <[email protected]>
John Wharington <[email protected]>
Lars H <[email protected]>
Rob Dunning <[email protected]>
Russell King <[email protected]>
Paolo Ventafridda <[email protected]>
Tobias Lohner <[email protected]>
Mirek Jezek <[email protected]>
Max Kellermann <[email protected]>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
};
foreach my $file (@ARGV) {
print STDERR "Fixing copyright in $file\n";
rename $file, $file . ".tmp";
open (IN, "< " . $file . ".tmp")
or die("Unable to open temp file " . $file . ".tmp - you may need to fix by hand - $!");
my $buffer;
{
local $/;
$buffer = <IN>;
}
close IN;
if ($buffer =~ s/Copyright_License\s*{[^}]*}/Copyright_License {$header}/) {
print "\tDone\n";
} else {
print "\tmissing Copyright_License { } entry\n";
}
open (OUT, "> $file")
or die("Unable to open original input file $file for output - $!");
print OUT $buffer;
close OUT;
unlink($file.".tmp");
}