Commit 090e0632 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

Added copyright check script.



Simple script to check the git log and mark the first date the file
was created on as the copyright date.
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent 0c77e93a
#! /bin/bash
for x in `find . ! -type d | grep -v .git | egrep -v '(src/openpa)'` ; do
if test -z "`git log $x`" ; then
continue
fi
listed=`grep "(C) [0-9]* by Argonne National Laboratory" $x | head -1 | \
sed -e 's/.*(C) \([0-9]*\) by Argonne National Laboratory.*/\1/g'`
if test -z "$listed" ; then
continue
fi
expected=`date --date="\`git log --follow 6a1cbdcf..HEAD $x | grep ^Date: | tail -1 | \
sed -e 's/Date: *//g' | cut -f1-5 -d' '\`" +'%Y'`
if test $listed -le 2007 ; then
# echo "ignoring $x because of cvs->svn migration date loss"
continue
fi
if test "$expected" != "$listed" ; then
# echo "$x (expected: $expected; listed: $listed)"
sed -i "s/(C) $listed by Argonne National Laboratory/(C) $expected by Argonne National Laboratory/g" $x
fi
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment