summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-08-26 17:02:32 +0200
committerJan Holesovsky <kendy@suse.cz>2010-08-26 17:02:32 +0200
commitc2fa1474cd21852bd4522d715d17948fbd47c1fb (patch)
treef0661c514df68bd03605e75dd31223fea8b86baa /git-hooks
parenta61989d47ff6f214cfaf4b42bf9f7683a0753d57 (diff)
Check for the old licenses.
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/pre-commit19
1 files changed, 18 insertions, 1 deletions
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index 36be8a683..19cebd81a 100755
--- a/git-hooks/pre-commit
+++ b/git-hooks/pre-commit
@@ -46,7 +46,6 @@ fi
# be strict about tabs - we don't want them at all, setup your editor
# correctly ;-)
CHECK_EXTENSIONS='\.\(c\|cpp\|cxx\|h\|hrc\|hxx\|idl\|inl\|java\|map\|mk\|MK\|pmk\|pl\|pm\|sdi\|sh\|src\|tab\|xcu\|xml\)$'
-
ERRORS="$(git diff-index --cached --name-only HEAD | while read FILE ; do
if echo "$FILE" | grep -qs "$CHECK_EXTENSIONS" ; then
if git diff-index -p --cached HEAD -- "$FILE" | grep -qs $'^+ *\t' ; then
@@ -65,6 +64,24 @@ if test -n "$ERRORS" ; then
exit 1
fi
+# check for old licenses
+CHECK_LICENSES='^+.*\(Sun Industry Standards Source License Version\|GNU Lesser General Public License Version 2.1\)'
+ERRORS="$(git diff-index --cached --name-only HEAD | while read FILE ; do
+ if git diff-index -p --cached HEAD -- "$FILE" | grep -qs "$CHECK_LICENSES" ; then
+ echo "$FILE"
+ fi
+ done)"
+if test -n "$ERRORS" ; then
+ echo "Error: Your change in the following files introduces old licenses:"
+ echo
+ echo "$ERRORS"
+ echo
+ echo "Please check with the author(s) that they agree with upgrading the"
+ echo "license to LGPL3, and change the license accondingly."
+ echo
+ exit 1
+fi
+
# git way of checking whitespace
exec git diff-index --check --cached $against --