Check for license on commit
Benjamin Meyer
ben at meyerhome.net
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: http://kde.icefox.net/tests/report.html). What do you think of
adding this to the pre-commit hook script to prevent more source without a
license?
-Benjamin Meyer
Note that the check-licenses script is from kdesdk/scripts
# Make sure that the code had a license
$CHECKLICENSES="/var/lib/svn/hooks/check_licenses"
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
done
$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
fi
rm -rf /tmp/$$
--
aka icefox
Public Key: http://www.icefox.net/public_key.asc
More information about the kde-core-devel
mailing list