]> git.proxmox.com Git - mirror_kronosnet.git/blob - build-aux/update-copyright.sh
[crypto] fix log information
[mirror_kronosnet.git] / build-aux / update-copyright.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2017-2019 Red Hat, Inc. All rights reserved.
4 #
5 # Author: Fabio M. Di Nitto <fabbione@kronosnet.org>
6 #
7 # This software licensed under GPL-2.0+
8 #
9
10 # script to update copyright dates across the tree
11
12 enddate=$(date +%Y)
13
14 input=$(grep -ril -e "Copyright.*Red Hat" |grep -v .swp |grep -v update-copyright |grep -v doxyxml.c)
15 for i in $input; do
16 startdate=$(git log --follow "$i" | grep ^Date: | tail -n 1 | awk '{print $6}')
17 if [ "$startdate" != "$enddate" ]; then
18 sed -i -e 's#Copyright (C).*Red Hat#Copyright (C) '$startdate'-'$enddate' Red Hat#g' $i
19 else
20 sed -i -e 's#Copyright (C).*Red Hat#Copyright (C) '$startdate' Red Hat#g' $i
21 fi
22 done
23
24 input=$(find . -type f |grep -v ".git")
25 for i in $input; do
26 if [ -z "$(grep -i "Copyright" $i)" ]; then
27 echo "WARNING: $i appears to be missing Copyright information"
28 fi
29 done