Blame maint/check_copyright.bash
|
Packit Service |
c5cf8c |
#! /bin/bash
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
numfiles=`git ls-files | egrep -v '(src/openpa)' | wc -l`
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
count=1
|
|
Packit Service |
c5cf8c |
for x in `git ls-files | egrep -v '(src/openpa)'` ; do
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if test ! -f $x ; then continue ; fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
echo -n "[$count/$numfiles] $x... "
|
|
Packit Service |
c5cf8c |
count=$(($count + 1))
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
listed=`grep "(C) [0-9]* by Argonne National Laboratory" $x | head -1 | \
|
|
Packit Service |
c5cf8c |
sed -e 's/.*(C) \([0-9]*\) by Argonne National Laboratory.*/\1/g'`
|
|
Packit Service |
c5cf8c |
if test -z "$listed" ; then
|
|
Packit Service |
c5cf8c |
echo "no copyright (ignoring)"
|
|
Packit Service |
c5cf8c |
continue
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
expected=`date --date="\`git log --follow --find-copies-harder -M -C 6a1cbdcf..HEAD $x | \
|
|
Packit Service |
c5cf8c |
grep ^Date: | tail -1 | sed -e 's/Date: *//g' | cut -f1-5 -d' '\`" +'%Y'`
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if test $listed -le 2007 ; then
|
|
Packit Service |
c5cf8c |
# echo "ignoring $x because of cvs->svn migration date loss"
|
|
Packit Service |
c5cf8c |
echo "pre-svn (ignoring)"
|
|
Packit Service |
c5cf8c |
continue
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if test "$expected" != "$listed" ; then
|
|
Packit Service |
c5cf8c |
# echo "$x (expected: $expected; listed: $listed)"
|
|
Packit Service |
c5cf8c |
sed -i "s/(C) $listed by Argonne National Laboratory/(C) $expected by Argonne National Laboratory/g" $x
|
|
Packit Service |
c5cf8c |
echo "incorrect (fixed)"
|
|
Packit Service |
c5cf8c |
continue
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
echo "nothing to fix"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
done
|