2010-01-07 14:36:41 +01:00
|
|
|
#!/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
|
|
|
|
|
2011-10-19 08:33:33 +00:00
|
|
|
for i in "$@" ; do
|
2010-01-07 14:36:41 +01:00
|
|
|
if test -f "$i" && test -s "$i" ; then
|
2011-05-06 14:59:43 +02:00
|
|
|
if head -n 35 "$1" | grep "qt-info@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
|
2011-02-21 14:24:22 +01:00
|
|
|
echo "$i: Copyright ok"
|
|
|
|
else
|
|
|
|
echo "$i: WRONG COPYRIGHT"
|
|
|
|
fi
|
2010-01-07 14:36:41 +01:00
|
|
|
else
|
2011-02-21 14:24:22 +01:00
|
|
|
echo "$i: NO COPYRIGHT"
|
2010-01-07 14:36:41 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|