summaryrefslogtreecommitdiff
path: root/tools/update-copyright.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-02 01:48:38 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-02 02:41:24 +0200
commit3eeae12c498d1a4dbe969462d2ba841f77ee3ccb (patch)
treeff8eab35e732bc0749fc11677c8873a7b3a58704 /tools/update-copyright.sh
downloadplus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.gz
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.bz2
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.xz
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.zip
Initial commit.
This code based on mana client http://www.gitorious.org/mana/mana and my private repository.
Diffstat (limited to 'tools/update-copyright.sh')
-rwxr-xr-xtools/update-copyright.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/update-copyright.sh b/tools/update-copyright.sh
new file mode 100755
index 000000000..8f924f53c
--- /dev/null
+++ b/tools/update-copyright.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Copyright (C) 2001-2010 Wormux Team.
+# Copyright (C) 2010 The ManaWorld Development Team.
+
+new_year="$1"
+[[ -z $new_year ]] && echo "Missing parameter: year" && exit 1
+
+[[ ! -e src ]] && echo "This script should be ran from the top mana/manaserv dir" && exit 2
+
+tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM"
+[[ -e $tmp_file ]] && tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM"
+
+# update the dates, creating the interval if it doesn't exist yet
+find -iname "*.cpp" -or -iname "*.h" -or -iname "*.hpp" |
+ xargs sed -i "/Copyright.*The Mana World Development Team/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ,"
+
+# do a semi-automated commit check
+git diff > $tmp_file
+echo "The next +/- counts mentioning copyrights should match:"
+grep "^[-+][^-+]" $tmp_file | sort | uniq -c
+echo "If they don't, try finding the offending files with grep -rl <\$bad_line>"
+
+# Remove temp file
+[[ -e $tmp_file ]] && rm $tmp_file