Imported Upstream version 1.1.0
[gammaray-debian.git] / add_license_blurb.sh
blob0b2583456916b807e681d41ab60fe0ff90b74775
1 #!/bin/bash
3 find "$@" -name '*.h' -o -name '*.cpp' | grep -v /3rdparty/ | grep -v /qmldebugcontrol/ | grep -v /build | while read FILE; do
4 if grep -qiE "Copyright \(C\) [0-9, -]{4,} Klar.*lvdalens Datakonsult AB" "$FILE" ; then continue; fi
5 thisfile=`basename $FILE`
6 authorName=`git config user.name`
7 authorEmail=`git config user.email`
8 thisYear=`date +%Y`
9 cat <<EOF > "$FILE".tmp
11 $thisfile
13 This file is part of GammaRay, the Qt application inspection and
14 manipulation tool.
16 Copyright (C) $thisYear Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
17 Author: $authorName <$authorEmail>
19 This program is free software; you can redistribute it and/or modify
20 it under the terms of the GNU General Public License as published by
21 the Free Software Foundation, either version 2 of the License, or
22 (at your option) any later version.
24 This program is distributed in the hope that it will be useful,
25 but WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 GNU General Public License for more details.
29 You should have received a copy of the GNU General Public License
30 along with this program. If not, see <http://www.gnu.org/licenses/>.
33 EOF
34 cat "$FILE" >> "$FILE".tmp
35 mv "$FILE".tmp "$FILE"
36 done
38 #remove the following exit if you want to add a header to CMakeLists.txt files
39 exit
41 find "$@" -name 'CMakeLists.txt' | while read FILE; do
42 if grep -qiE "Copyright \(C\) [0-9, -]{4,} Klar.*lvdalens Datakonsult AB" "$FILE" ; then continue; fi
43 cat <<EOF > "$FILE".tmp
44 # This file is part of GammaRay, the Qt application inspection and
45 # manipulation tool.
47 # Copyright (C) 2010-2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
48 # Author: Volker Krause <volker.krause@kdab.com>
50 # This program is free software; you can redistribute it and/or modify
51 # it under the terms of the GNU General Public License as published by
52 # the Free Software Foundation, either version 3 of the License, or
53 # (at your option) any later version.
55 # This program is distributed in the hope that it will be useful,
56 # but WITHOUT ANY WARRANTY; without even the implied warranty of
57 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58 # GNU General Public License for more details.
60 # You should have received a copy of the GNU General Public License
61 # along with this program. If not, see <http://www.gnu.org/licenses/>.
63 EOF
64 cat "$FILE" >> "$FILE".tmp
65 mv "$FILE".tmp "$FILE"
66 done