Files
qt-creator/scripts/hasCopyright.sh
Robert Loehning 453fa17432 Improved sample usage in hasCopyright.sh
Change-Id: Iae3ef128e62faba579ce7385bedc90a4e4600019
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-03-05 09:50:41 +01:00

26 lines
865 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 ./scripts/hasCopyright.sh
for i in "$@" ; do
if test -f "$i" && test -s "$i" ; then
if head -n 35 "$1" | grep "info@qt.nokia.com" > /dev/null 2>&1 ; then
echo "$i: OLD EMAIL IN USE!"
elif head -n 35 "$i" | grep Copyright > /dev/null 2>&1 ; then
if head -n 35 "$i" | grep "GNU Lesser General Public License" > /dev/null 2>&1 &&
head -n 35 "$i" | grep "Other Usage" > /dev/null 2>&1 ; then
echo "$i: Copyright ok"
else
echo "$i: WRONG COPYRIGHT"
fi
else
echo "$i: NO COPYRIGHT"
fi
fi
done