File: fix_copyright.sh

package info (click to toggle)
mapnik 4.2.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,592 kB
  • sloc: cpp: 163,859; python: 1,332; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (20 lines) | stat: -rwxr-xr-x 469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

if [ $# -ne 1 ]
then
  echo "Usage: `basename $0` YEAR"
  exit 1
fi

YEAR=$1
DIRECTORIES=( "include/mapnik" "src" "plugins/input" "demo/c++" "demo/viewer" "utils" "test" )

SED="sed -i -e"
COMMAND="s: \* Copyright (C) 20[0-9][0-9].*: \* Copyright (C) $YEAR Artem Pavlenko:g"

for d in "${DIRECTORIES[@]}"
do
  for f in $(find "../../$d" -type f \( -iname '*.hpp' -o -iname '*.cpp' -o -iname '*.h' -o -iname '*.c' \)); do
    $SED "$COMMAND" $f
  done
done