Check for license on commit

Benjamin Meyer ben at
Tue May 10 15:38:26 BST 2005

In my personal svn I have added the following pre-commit check to make sure 
that every file that I add/modify has a proper license.  There are a lot of 
files inside KDE that do not conform to the KDE licencing policy (daily 
report:  What do you think of 
adding this to the pre-commit hook script to prevent more source without a 

-Benjamin Meyer

Note that the check-licenses script is from kdesdk/scripts

# Make sure that the code had a license
mkdir /tmp/$$
$SVNLOOK diff $REPOS -t $TXN  | grep +++ | cut -c 5- | cut -f 1 | while read 
f ; do
  $SVNLOOK cat $REPOS $f -t $TXN > /tmp/$$/`basename $f` 2> /tmp/$$/errors
$CHECKLICENSES /tmp/$$ > /tmp/$$/check 2> /tmp/$$/check_error || exit 1
count=`cat /tmp/27897/check | wc -l`
if [ ! $count -eq 0 ] ; then
  echo "The following files don't have licenses:" >&2
  cat /tmp/$$/check >&2
  exit 1
rm -rf /tmp/$$

aka icefox
Public Key:

More information about the kde-core-devel mailing list