1#! /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#
6#     "Copyright (C) 20xy-2010"
7#
8# where x can be 0 or 1 and y can be anything.
9# To use:
10# - change the years in the 'perl' command below appropriately.
11# - 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#
16
17# The find command deliberately skips .svn/ subdirs -- we don't want to
18# change them.
19for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do
20    echo $i
21    perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2010/Copyright (C) 20$1$2-2011/' < $i > tmp.$$
22    mv tmp.$$ $i
23done
24
25