1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/bin/sh
# BZFlag
# Copyright (c) 1993-2025 Tim Riker
#
# This package is free software; you can redistribute it and/or
# modify it under the terms of the license found in the file
# named COPYING that should have accompanied this file.
#
# THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# NOTE: update just the next two lines and then run this script
OLDCOPYRIGHTTEXT='Copyright (c) 1993-2025'
NEWCOPYRIGHTTEXT="Copyright (c) 1993-`date +%Y`"
#
# update copyright in all files
#
# bzflag top-level dir
cd `git worktree list --porcelain | awk '$1 == "worktree" {print $2}'` || exit 1
myname=touchcopyright
tmpfile=$myname.tmp
rm -f $tmpfile
# touch myself last
files="`git ls-files | egrep -v misc/$myname'|\.(bmp|icns|ico|png|psd|wav)$'` misc/$myname"
# do replacement
for file in $files; do
echo -e -n "$file\r"
if [ ! -w ${file} ]; then
echo "${file} not found or not writable."
continue
fi
# cat to the file, not move to preserve permissions
if sed -e "s/${OLDCOPYRIGHTTEXT}/${NEWCOPYRIGHTTEXT}/" < ${file} > $tmpfile ; then
cat $tmpfile > ${file}
fi
done
rm -f $tmpfile
# Local Variables: ***
# mode: sh ***
# tab-width: 8 ***
# sh-indentation: 2 ***
# sh-basic-offset: 2 ***
# indent-tabs-mode: t ***
# End: ***
# ex: shiftwidth=2 tabstop=8
|