From cc4640f1a008dd9c9d8fe63326f875c317cd884c Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 24 Jan 2016 14:34:26 +0100 Subject: [PATCH] Fix a bug in check-copyright. --- caca/t/check-copyright | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/caca/t/check-copyright b/caca/t/check-copyright index 2cf25d64..d8074a5f 100755 --- a/caca/t/check-copyright +++ b/caca/t/check-copyright @@ -20,11 +20,12 @@ 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 log "${top_srcdir}/${dir}/$x" | head -n 3 | sed 's/^/info: /' nfails=$(($nfails + 1)) fi fi