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 | 03f8d3f | 2012-08-05 15:46:46 +0000 | [diff] [blame] | 6 | # "Copyright (C) 20xy-2011" |
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. |
sewardj | 7a2505d | 2006-06-05 23:20:25 +0000 | [diff] [blame] | 19 | for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 20 | echo $i |
sewardj | 03f8d3f | 2012-08-05 15:46:46 +0000 | [diff] [blame] | 21 | perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2011/Copyright (C) 20$1$2-2012/' < $i > tmp.$$ |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 22 | mv tmp.$$ $i |
florian | e808f81 | 2012-08-06 18:34:24 +0000 | [diff] [blame] | 23 | |
| 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 |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 28 | done |
| 29 | |