summaryrefslogtreecommitdiffstats
path: root/update-copyright.sh
blob: bb565414a1cf4e7733f65710baf01cb3295c2902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

oldyear=2021
newyear=2022

for dir in src include tools tests; do
    for ext in cc h; do
	find $dir -maxdepth 1 -name *.$ext \
	    -exec sed -i -r \
	     "s/(Copyright \(C\) .*?-)$oldyear (.*?\.)/\1$newyear \2/" \
	     {} \; \
	     -exec sed -i -r \
	     "s/(Copyright \(C\)) ($oldyear) (.*?\.)/\1 $oldyear-$newyear \3/" \
	     {} \;
    done
done