File: touchcopyright

package info (click to toggle)
bzflag 2.0.2.20050318
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 20,464 kB
  • ctags: 24,134
  • sloc: cpp: 110,038; ansic: 9,514; sh: 4,105; makefile: 1,922; perl: 280; python: 221; xml: 180; objc: 178; php: 143
file content (48 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download
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
#!/bin/sh
# BZFlag
# Copyright (c) 1993 - 2005 Tim Riker
OLDCOPYRIGHTTEXT='Copyright (c) 1993 - 2005'
# NOTE: update just this line and then run the script
NEWCOPYRIGHTTEXT='Copyright (c) 1993 - 2005'
#
# update copyright in all files
#
# bzflag top-level dir
for root in . .. ; do
  if [ -r $root/bzflag.lsm.in ] ; then
    break
  fi
done

if [ -r $root/include/config.h ] ; then
  echo "$0 should be run only after a make maintianer-clean!"
  exit 1
fi
myname=touchcopyright
tmpfile=$root/$myname.tmp
rm -f $tmpfile
# touch myself last
files="`find $root -type f | grep -v 'png$' | grep -v misc/$myname` 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