Commit 8e2bbdff authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Cosmetic improvements.

parent 7d082050
#!/bin/bash
# $Id: update-copyright,v 1.1 1994/04/05 07:49:23 ceder Exp $
# $Id: update-copyright,v 1.2 1995/01/01 19:21:25 ceder Exp $
# Copyright (C) 1994 Lysator Academic Computer Association.
#
# This program is free software; you can redistribute it and/or modify
......@@ -17,19 +17,32 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
set -e
# This file updates the copyright lines found in the programs, making
# sure that every year that the file is edited appears in the
# copyright line.
while read file
do
grep 'Copyright' $file \
| tr , '\012' \
if grep '[C]opyright' $file > /tmp/$$.yc ; then : ;
else echo "$file:1: no Copy"right" line found" >&2 ; continue;
fi
tr , '\012' < /tmp/$$.yc \
| sed -n 's/.*\([0-9][0-9][0-9][0-9]\).*/\1/p' > /tmp/$$.year
cvs log $file \
if cvs log $file > /tmp/$$.yc ; then : ;
else echo "$file:1: cvs log failed" >&2 ; continue;
fi
cat /tmp/$$.yc \
| 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/' \
sed 's/\([C]opyright[^0-9]*\)[0-9 ,]*[0-9]\([^0-9]*\)/\1'"$y"'\2/' \
< $file > /tmp/$$.file
mv /tmp/$$.file $file
cmp /tmp/$$.file $file >/dev/null
if [ $? = 1 ]; then
cat /tmp/$$.file > $file;
echo $file updated
fi
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment