File: change-copyright-year

package info (click to toggle)
valgrind 1%3A3.12.0~svn20160714-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 120,428 kB
  • ctags: 70,855
  • sloc: ansic: 674,645; exp: 26,134; xml: 21,574; asm: 7,570; cpp: 7,567; makefile: 7,380; sh: 6,188; perl: 5,855; haskell: 195
file content (29 lines) | stat: -rwxr-xr-x 1,040 bytes parent folder | download
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
26
27
28
29
#! /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) 20xy-2012"
#
# where x can be 0 or 1 and y can be anything.
# To use:
# - change the years in the 'perl' 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.
#

# The find command deliberately skips .svn/ subdirs -- we don't want to
# change them.
for i in `find . -name '*.[chS]' -o -name '*.in' -type f -not -path '*.svn\/*'` ; do
    echo $i
    if [ -L $i ]; then continue; fi  # skip symbolic links
    perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2013/Copyright (C) 20$1$2-2015/' < $i > tmp.$$
    mv tmp.$$ $i

# Copyright IBM Corp. 2010-2011

    perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2013/Copyright IBM Corp. 20$1$2-2015/' < $i > tmp.$$
    mv tmp.$$ $i
done