diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-27 00:47:02 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-31 23:38:50 +0100 |
commit | 0a706a6c97bd0da549e75c7a3cba4f1e831059df (patch) | |
tree | 82c246889972439de0a211f8c80b74138719d09e | |
parent | 7de429cbcd838326dd455e7d182cb5ef19a611c9 (diff) | |
download | mana-0a706a6c97bd0da549e75c7a3cba4f1e831059df.tar.gz mana-0a706a6c97bd0da549e75c7a3cba4f1e831059df.tar.bz2 mana-0a706a6c97bd0da549e75c7a3cba4f1e831059df.tar.xz mana-0a706a6c97bd0da549e75c7a3cba4f1e831059df.zip |
Upgrade the update_copyright.sh script.
It is now listing possible source files lacking the copyright notice.
I also made the copyright notice text easily configurable.
Reviewed-by: Erik Schilling
-rwxr-xr-x | tools/update-copyright.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/update-copyright.sh b/tools/update-copyright.sh index 88278345..aaf7a3f9 100755 --- a/tools/update-copyright.sh +++ b/tools/update-copyright.sh @@ -1,8 +1,10 @@ #!/bin/bash # Copyright (C) 2001-2010 Wormux Team. # Copyright (C) 2010 The Mana World Development Team. +# Copyright (C) 2012 The Mana Developers new_year="$1" +copyright_notice="The Mana Developers" [[ -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 @@ -12,7 +14,7 @@ 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 Developers/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ," + xargs sed -i "/Copyright.*$copyright_notice/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ," # do a semi-automated commit check git diff > $tmp_file @@ -22,3 +24,9 @@ echo "If they don't, try finding the offending files with grep -rl <\$bad_line>" # Remove temp file [[ -e $tmp_file ]] && rm $tmp_file + +# Indicate the source file that may miss the copyright notice. +echo "Those files are missing the given Copyright notice." +echo "You might want to check them:" +find src/ -type f -name "*.[Cc][Pp][Pp]" -or -name "*.[Hh]" -or -name "*.[Cc]" -or -name "*.[Hh][Pp][Pp]" | xargs grep -RiL "$copyright_notice" +echo "End of $0 script." |