-
Notifications
You must be signed in to change notification settings - Fork 214
/
addLicense
executable file
·89 lines (81 loc) · 3.16 KB
/
addLicense
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Copyright 2013 Axel Huebl, Rene Widera
#
# This file is part of PIConGPU.
#
# PIConGPU 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 3 of the License, or
# (at your option) any later version.
#
# PIConGPU 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 PIConGPU.
# If not, see <http://www.gnu.org/licenses/>.
#
fileName=$1
projectName=${PROJECT_NAME:-"PIConGPU"}
rename="s/psychocoder/Rene Widera/g;
s/rp6038/Richard Pausch/g;
s/fschmitt/Felix Schmitt/g;
s/ahuebl/Axel Huebl/g;
s/heiko/Heiko Burau/g;
s/steinigk/Klaus Steiniger/g;
s/ben_schneider/Benjamin Schneider/g;
s/whoenig/Wolfgang Hoenig/g;
s/rdietric/Robert Dietric/g;
s/phoenixloe/Florian Berninger/g;
s/helma/Anton Helm/g;
s/wf5/Wen Fu/g;
s/bussmann/Michael Bussmann/g
"
#author=`svn log "$fileName" --quiet | grep "^r" | awk '{print $3}' | sort | uniq | tr "\n" "," | sed 's/,$//g' | sed 's/,/, /g'`
#author=`echo "$author" | sed "$rename"`
author=`git log --follow --pretty=format:%an "$fileName" | sort | uniq | sed "$rename" | uniq | tr "\n" "," | sed 's/,$//g' | sed 's/,/, /g'`
if [ $projectName = "PIConGPU" ] ; then
text=' *\
* This file is part of '"$projectName"'.\
*\
* '"$projectName"' 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 3 of the License, or\
* (at your option) any later version.\
*\
* '"$projectName"' 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 '"$projectName"'.\
* If not, see <http://www.gnu.org/licenses/>.\
*/\
'
else
text=' *\
* This file is part of '"$projectName"'.\
*\
* '"$projectName"' is free software: you can redistribute it and/or modify\
* it under the terms of of either the GNU General Public License or\
* the GNU Lesser General Public License as published by\
* the Free Software Foundation, either version 3 of the License, or\
* (at your option) any later version.\
*\
* '"$projectName"' 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 and the GNU Lesser General Public License\
* for more details.\
*\
* You should have received a copy of the GNU General Public License\
* and the GNU Lesser General Public License along with '"$projectName"'.\
* If not, see <http://www.gnu.org/licenses/>.\
*/\
'
fi
sed -s -i '1i\'"$text" $fileName
sed -s -i '1i\/**\n * Copyright '`date +%G`' '"$author" $fileName
exit 0