File: fix_copyright.sh

package info (click to toggle)
mapnik 3.1.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,208 kB
  • sloc: cpp: 144,467; python: 30,152; sh: 797; makefile: 166; xml: 140; lisp: 13
file content (20 lines) | stat: -rwxr-xr-x 454 bytes parent folder | download | duplicates (6)
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" )

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