summaryrefslogtreecommitdiff
path: root/auxprogs/change-copyright-year
blob: 4901df4805f950b18b7c6fa9b23e53579c9170b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh
#
# Script updates the copyright year in every file in Valgrind that contains
# a copyright notice.  Assumes they're all in the same format:
#
#     "Copyright (C) 200x-200y"
#
# To use:
# - change the years in the 'sed' command below appropriately.
# - Run it from the base directory of a Valgrind workspace.  
# - And check the results look ok by diff'ing against the repository.
#
# Note that it will spit out some warnings when it runs;  ignore these.
#
# Nb: after 2009, the sed string may have to be changed slightly -- it
# currently assumes the first year is in the range 2000..2009.

# The find command deliberately skips .svn/ subdirs -- we don't want to
# change them.
for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do
    echo $i
    perl -p -e 's/Copyright \(C\) 200([0-9])-2009/Copyright (C) 200$1-2010/' < $i > tmp.$$
    mv tmp.$$ $i
done