blob: d6a50dfd9ab28ded8602ee175071f91ab3efd013 [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#
sewardj03f8d3f2012-08-05 15:46:46 +00006# "Copyright (C) 20xy-2011"
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
sewardj03f8d3f2012-08-05 15:46:46 +000021 perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2011/Copyright (C) 20$1$2-2012/' < $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
26 perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2011/Copyright IBM Corp. 20$1$2-2012/' < $i > tmp.$$
27 mv tmp.$$ $i
njnbb372652006-06-01 13:44:07 +000028done
29