blob: 4c6f90a376b0fc57e674a07cba861d5d7db673cc [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.
sewardj7a2505d2006-06-05 23:20:25 +000019for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do
njnbb372652006-06-01 13:44:07 +000020 echo $i
sewardj0f157dd2013-10-18 14:27:36 +000021 perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2012/Copyright (C) 20$1$2-2013/' < $i > tmp.$$
njnbb372652006-06-01 13:44:07 +000022 mv tmp.$$ $i
floriane808f812012-08-06 18:34:24 +000023
24# Copyright IBM Corp. 2010-2011
25
sewardj0f157dd2013-10-18 14:27:36 +000026 perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2012/Copyright IBM Corp. 20$1$2-2013/' < $i > tmp.$$
floriane808f812012-08-06 18:34:24 +000027 mv tmp.$$ $i
njnbb372652006-06-01 13:44:07 +000028done
29