File: copyright-sh

package info (click to toggle)
libreswan 5.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,644 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (18 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# script used to gather/commit updated copyrights not done by the authors
YEAR=2019

cd ~/libreswan

for i in `git log --since $YEAR/01/01 |grep ^commit | sed "s/commit //"`;
do
   export a=`git show $i | grep -E "Author" | sed "s/Author: //"`; 
   for f in `git show $i | grep "+++ b\/" |sed "s/^......//"`;
   do
      sed -i "s/^\(.*Copyright ... ....\)\([-,]\)20.. $a/\1-$YEAR $a/" $f
      sed -i "s/^\(.*Copyright ... ....\) $a/\1-$YEAR $a/" $f
      # builds a list of copyright lines that still needs to added semi-manually
      grep -E "Copyright.* $a" $f || echo "$f: Copyright (C) $YEAR $a"
   done
done