Files
qt-creator/scripts/hasCopyright.sh
Tobias Hunger 1d3adef24a Script: Update hasCopyright script
Update hasCopyright script to distinguish between no/wrong
copyright.
2011-02-21 14:44:54 +01:00

23 lines
651 B
Bash
Executable File

#!/bin/sh
# Scan files given on the command line for a copyright header.
# Only the first 15 lines will be examined and must contain the
# string 'Copyright'.
#
# Sample usage:
# find . -type f -name \*.cpp -o -name \*.h | xargs ~/bin/hasCopyright.sh
for i in $@ ; do
if test -f "$i" && test -s "$i" ; then
if head -n 15 "$i" | grep Copyright > /dev/null 2>&1 ; then
if head -n 15 "$i" | grep "No Commercial Usage" > /dev/null 2>&1 ; then
echo "$i: Copyright ok"
else
echo "$i: WRONG COPYRIGHT"
fi
else
echo "$i: NO COPYRIGHT"
fi
fi
done