[ooo-build-commit] .: git-hooks/pre-commit

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Aug 26 08:16:19 PDT 2010


 git-hooks/pre-commit |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit c2fa1474cd21852bd4522d715d17948fbd47c1fb
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Aug 26 17:02:32 2010 +0200

    Check for the old licenses.

diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index 36be8a6..19cebd8 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 --
 


More information about the ooo-build-commit mailing list