blob: e6b98028ab366247e89ac53b6e21bfa2b838c5df [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#
sewardj0f157dd2013-10-18 14:27:36 +00006# "Copyright (C) 20xy-2012"
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
22 perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2013/Copyright (C) 20$1$2-2014/' < $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
florian06766bd2014-06-23 19:33:45 +000027 perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2013/Copyright IBM Corp. 20$1$2-2014/' < $i > tmp.$$
floriane808f812012-08-06 18:34:24 +000028 mv tmp.$$ $i
njnbb372652006-06-01 13:44:07 +000029done