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 | # |
| 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. |
sewardj | 7a2505d | 2006-06-05 23:20:25 +0000 | [diff] [blame] | 20 | for i in `find . -name '*.[chS]' -type f -not -path '*.svn\/*'` ; do |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 21 | echo $i |
sewardj | 9eecbbb | 2010-05-03 21:37:12 +0000 | [diff] [blame] | 22 | perl -p -e 's/Copyright \(C\) 200([0-9])-2009/Copyright (C) 200$1-2010/' < $i > tmp.$$ |
njn | bb37265 | 2006-06-01 13:44:07 +0000 | [diff] [blame] | 23 | mv tmp.$$ $i |
| 24 | done |
| 25 | |