Renderer, ...: use PixelRect::GetCenter()
[xcsoar.git] / tools / FixHeaders.pl
bloba93bc7befed8c8659e91cf63625dd3d884ae4c13
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
5 my $header = q{
7 XCSoar Glide Computer - http://www.xcsoar.org/
8 Copyright (C) 2000-2013 The XCSoar Project
9 A detailed list of copyright holders can be found in the file "AUTHORS".
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 foreach my $file (@ARGV) {
27 print STDERR "Fixing copyright in $file\n";
28 rename $file, $file . ".tmp";
29 open (IN, "< " . $file . ".tmp")
30 or die("Unable to open temp file " . $file . ".tmp - you may need to fix by hand - $!");
31 my $buffer;
33 local $/;
34 $buffer = <IN>;
36 close IN;
38 if ($buffer =~ s/Copyright_License\s*{[^}]*}/Copyright_License {$header}/) {
39 print "\tDone\n";
40 } else {
41 print "\tmissing Copyright_License { } entry\n";
44 open (OUT, "> $file")
45 or die("Unable to open original input file $file for output - $!");
46 print OUT $buffer;
47 close OUT;
48 unlink($file.".tmp");