#!/bin/sh
# BZFlaga
# NOTE: update all three lines below
# Copyright (c) 1993 - 2001 Tim Riker
OLDCOPYRIGHTTEXT='Copyright (c) 1993 - 2001'
NEWCOPYRIGHTTEXT='Copyright (c) 1993 - 2001'
#
# update copyright in all files
#

# bzflag top-level dir
for root in . .. ; do
    if [ -r $root/config ] ; then
	break
    fi
done

if [ -r ../bin/bzfs ] ; then
 echo "$0 should be run only after a make pristine!"
 exit 1
fi

rm -f updatecopyright.tmp
files=`find $root -type f | grep -v updatecopyright`

# do replacement
for file in $files; do
 if [ ! -w ${file} ]; then
  echo "${file} not found or not writable."
  continue
 fi
 sed -e "s/${OLDCOPYRIGHTTEXT}/${NEWCOPYRIGHTTEXT}/" < ${file} > updatecopyright.tmp
 mv updatecopyright.tmp ${file}
done
rm -f updatecopyright.tmp
