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