njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 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 | # |
sewardj | 0f157dd | 2013-10-18 14:27:36 +0000 | [diff] [blame] | 6 | # "Copyright (C) 20xy-2012" |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 7 | # |
sewardj | 20cf5bd | 2011-10-23 07:31:08 +0000 | [diff] [blame] | 8 | # where x can be 0 or 1 and y can be anything. |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 9 | # To use: |
sewardj | 20cf5bd | 2011-10-23 07:31:08 +0000 | [diff] [blame] | 10 | # - change the years in the 'perl' command below appropriately. |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 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 | # |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 16 | |
| 17 | # The find command deliberately skips .svn/ subdirs -- we don't want to |
| 18 | # change them. |
florian | 06766bd | 2014-06-23 19:33:45 +0000 | [diff] [blame^] | 19 | for i in `find . -name '*.[chS]' -o -name '*.in' -type f -not -path '*.svn\/*'` ; do |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 20 | echo $i |
florian | 06766bd | 2014-06-23 19:33:45 +0000 | [diff] [blame^] | 21 | if [ -L $i ]; then continue; fi # skip symbolic links |
| 22 | perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2013/Copyright (C) 20$1$2-2014/' < $i > tmp.$$ |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 23 | mv tmp.$$ $i |
florian | e808f81 | 2012-08-06 18:34:24 +0000 | [diff] [blame] | 24 | |
| 25 | # Copyright IBM Corp. 2010-2011 |
| 26 | |
florian | 06766bd | 2014-06-23 19:33:45 +0000 | [diff] [blame^] | 27 | perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2013/Copyright IBM Corp. 20$1$2-2014/' < $i > tmp.$$ |
florian | e808f81 | 2012-08-06 18:34:24 +0000 | [diff] [blame] | 28 | mv tmp.$$ $i |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 29 | done |