Skip to content
Snippets Groups Projects
Commit 2245d073 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

First try.

parent 0c455ce2
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# $Id: update-copyright,v 1.1 1994/04/05 07:49:23 ceder Exp $
# Copyright (C) 1994 Lysator Academic Computer Association.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
set -e
while read file
do
grep 'Copyright' $file \
| tr , '\012' \
| sed -n 's/.*\([0-9][0-9][0-9][0-9]\).*/\1/p' > /tmp/$$.year
cvs log $file \
| sed -n 's/^date: \([0-9][0-9][0-9][0-9]\).*author.*state.*$/\1/p' \
| sort | uniq >> /tmp/$$.year
y=`sort /tmp/$$.year | uniq \
| (read first ; echo -n $first; \
while read second; do echo -n ", $second"; done)`
sed 's/\(Copyright[^0-9]*\)[0-9 ,]*[0-9]\([^0-9]*\)/\1'"$y"'\2/' \
< $file > /tmp/$$.file
mv /tmp/$$.file $file
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment