1
0

scripts: two scripts to determine copyright holder of files

This commit is contained in:
Wesley W. Terpstra
2016-11-27 15:36:02 -08:00
parent 4146f6a792
commit 8510d9e697
5 changed files with 268 additions and 0 deletions

9
scripts/modify-copyright Executable file
View File

@ -0,0 +1,9 @@
#! /bin/sh
d=$(dirname "$0")
threshold=10
for i in $(git ls-tree -r HEAD . | grep '\.\(scala\|cc\|v\)' | cut -f2); do
("$d/copyright-file" "$i" | sort -rn | awk 'NR == 1 || $1 > '$threshold' { print }' | sed 's@[^A-Z]*@// See LICENSE.@;s@$@ for license details.@;$a\\'; \
grep -v "^// See LICENSE" $i | sed '/./,$!d') > $i.tmp
mv $i.tmp $i
done