change-copyright-year revision 9eecbbb9a9cbbd30b903c09a9e04d8efc20bda33
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) 200x-200y"
7#
8# To use:
9# - change the years in the 'sed' command below appropriately.
10# - Run it from the base directory of a Valgrind workspace.  
11# - And check the results look ok by diff'ing against the repository.
12#
13# Note that it will spit out some warnings when it runs;  ignore these.
14#
15# Nb: after 2009, the sed string may have to be changed slightly -- it
16# currently assumes the first year is in the range 2000..2009.
17
18# The find command deliberately skips .svn/ subdirs -- we don't want to
19# change them.
20for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do
21    echo $i
22    perl -p -e 's/Copyright \(C\) 200([0-9])-2009/Copyright (C) 200$1-2010/' < $i > tmp.$$
23    mv tmp.$$ $i
24done
25
26