update-copyright 1.41 KB
Newer Older
1 2
#!/bin/bash

3
# Copyright (C) 2004-2019 Savoir-faire Linux Inc.
4
#
5
# Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
6
#
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12 13 14 15
# 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.
16
#
17
# You should have received a copy of the GNU General Public License
18 19
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
20
#
21

22
# List all files in current directory
Guillaume Roguez's avatar
Guillaume Roguez committed
23 24
FILES=`find -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.i" -o -name "*.sh" -o -name "*.py" -o -name "*.mm" -o -name "*.patch" -o -name "README"`
FILES+=" ./configure.ac ./tools/update-copyright"
25
year=`date +%Y`
26 27

# Loop and replace
28
for f in $FILES
29
do
30 31
  sed -i "/$year/b; s/\-[0-9]\+ \(by \)\?Savoir-[fF]aire Linux/-$year Savoir-faire Linux/g" $f
  sed -i "/$year/b; s/ \([0-9]\+\) \(by \)\?Savoir-[fF]aire Linux/ \1-$year Savoir-faire Linux/g" $f
32
  sed -i "/$year/b; s/Savoir-[fF]aire Linux \([0-9]\+\)\-[0-9]\+/Savoir-faire Linux \1-$year/g" $f
33 34 35
done

exit 0;