Skip to content

Commit

Permalink
Fix a bug in check-copyright.
Browse files Browse the repository at this point in the history
  • Loading branch information
samhocevar committed Jan 24, 2016
1 parent 9b14aa4 commit e891163
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions caca/t/check-copyright
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ for dir in $(make -s echo-dirs -C "${top_srcdir}"); do
if ! grep 'Copyright *([cC])' "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x lacks proper copyright information"
nfails=$(($nfails + 1))
elif [ -d ../../.git ]; then
elif [ -d "${top_srcdir}/.git" ]; then
Y="$(git log "${top_srcdir}/${dir}/$x" | head -n 3 | sed -ne 's/^Date.* \([0-9][0-9][0-9][0-9]\) .*/\1/p')"
if [ "$Y" != "" ]; then
if ! grep "$Y.*@" "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x last modified in $Y, which is not in copyright"
echo "error: ${top_srcdir}/${dir}/$x last modified in $Y, which is not in copyright"
git branch -a | sed 's/^/info: /'
git log --stat "${top_srcdir}/${dir}/$x" | sed 's/^/info: /'
nfails=$(($nfails + 1))
fi
fi
Expand Down

0 comments on commit e891163

Please sign in to comment.