blob: 4e7f5c73bbc94396a1e3929c1686c572313793d6 [file] [log] [blame]
njnbb372652006-06-01 13:44:07 +00001#! /bin/sh
2#
3# Script updates the copyright year in every file in Valgrind that contains
4# a copyright notice. Assumes they're all in the same format:
5#
Elliott Hughesed398002017-06-21 14:41:24 -07006# "Copyright (C) 20xy-2017"
njnbb372652006-06-01 13:44:07 +00007#
sewardj20cf5bd2011-10-23 07:31:08 +00008# where x can be 0 or 1 and y can be anything.
njnbb372652006-06-01 13:44:07 +00009# To use:
sewardj20cf5bd2011-10-23 07:31:08 +000010# - change the years in the 'perl' command below appropriately.
njnbb372652006-06-01 13:44:07 +000011# - Run it from the base directory of a Valgrind workspace.
12# - And check the results look ok by diff'ing against the repository.
13#
14# Note that it will spit out some warnings when it runs; ignore these.
15#
njnbb372652006-06-01 13:44:07 +000016
17# The find command deliberately skips .svn/ subdirs -- we don't want to
18# change them.
florian06766bd2014-06-23 19:33:45 +000019for i in `find . -name '*.[chS]' -o -name '*.in' -type f -not -path '*.svn\/*'` ; do
njnbb372652006-06-01 13:44:07 +000020 echo $i
florian06766bd2014-06-23 19:33:45 +000021 if [ -L $i ]; then continue; fi # skip symbolic links
Elliott Hughesed398002017-06-21 14:41:24 -070022 perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2015/Copyright (C) 20$1$2-2017/' < $i > tmp.$$
njnbb372652006-06-01 13:44:07 +000023 mv tmp.$$ $i
floriane808f812012-08-06 18:34:24 +000024
25# Copyright IBM Corp. 2010-2011
26
Elliott Hughesed398002017-06-21 14:41:24 -070027 perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2015/Copyright IBM Corp. 20$1$2-2017/' < $i > tmp.$$
floriane808f812012-08-06 18:34:24 +000028 mv tmp.$$ $i
njnbb372652006-06-01 13:44:07 +000029done