summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-21 14:05:16 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-21 14:05:16 +0000
commitbf628df696bf121bb21548c6d260485b6a2ff80b (patch)
tree9af78c05c8aa320b9d1ef12e49a37ff4a47eee11
parente5050a0fba3f6d1b1614dc9d96fed3366538e6ba (diff)
downloadmpfr-bf628df696bf121bb21548c6d260485b6a2ff80b.tar.gz
[tools/ck-copyright-notice] Update from the trunk.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9442 280ebfd0-de03-0410-8827-d642c229c3f4
-rwxr-xr-xtools/ck-copyright-notice35
1 files changed, 27 insertions, 8 deletions
diff --git a/tools/ck-copyright-notice b/tools/ck-copyright-notice
index 290390f03..064698bb6 100755
--- a/tools/ck-copyright-notice
+++ b/tools/ck-copyright-notice
@@ -11,31 +11,50 @@
# PARTICULAR PURPOSE.
# ck-copyright-notice can be run from the tools directory
-dir=`pwd`
-[ -d src ] || [ "`basename "$dir"`" != tools ] || cd ..
+dir=$(pwd)
+[ -d src ] || [ "$(basename "$dir")" != tools ] || cd ..
+
+err=0
# Note: if paragraphs are reformatted, this may need to be updated.
-lgpl="`sed -n '/version [0-9.]* or any later version/ {
+yrx="\([0-9][0-9][0-9][0-9]\)"
+
+lgpl=$(sed -n "/version [0-9.]* or any later version/ {
s/.*version //
s/ or.*//
p
q
- }' doc/mpfr.texi`"
+ }" doc/mpfr.texi)
+
+clyr=$(sed -n "/^r/ {
+ s/.* | $yrx-.*/\1/p
+ q
+ }" ChangeLog)
# Do not use "find ... | while read file do ... done" because the "do"
# part needs to be run in the current shell, and some shells behave in
# a different way.
-srctests=`find src tests -name '*.[ch]'`
+srctests=$(find examples src tests -name '*.[ch]')
-err=0
-for file in $srctests
+# Take the copyright notice last year of NEWS file as a reference.
+z=$(sed -n "s/^Copyright 2000-$yrx Free Software Foundation.*/\1/p" NEWS)
+
+if [ $z -lt $clyr ]; then
+ echo "The copyright year of NEWS is out-of-date."
+ err=1
+fi
+
+for file in $srctests BUGS INSTALL README TODO configure.ac
do
y=""
case $file in
tests/RRTest.c)
# This file doesn't have a copyright notice, but isn't distributed.
continue ;;
+ src/mini-gmp.[ch])
+ # These files may have been added by the user or 3rd party.
+ continue ;;
src/mpfr-longlong.h)
# This file (which comes from GMP) has a specific copyright notice.
continue ;;
@@ -44,7 +63,7 @@ do
*/mparam.h)
y="2005-" ;;
esac
- grep -q "Copyright $y.* Free Software Foundation" "$file" && \
+ grep -q "Copyright $y.*$z Free Software Foundation" "$file" && \
grep -q "GNU MPFR Library" "$file" && \
grep -q "either version $lgpl of the License" "$file" && continue
echo "Possibly missing or incorrect copyright notice in $file"