annotate check-copyright @ 40196:e63f5d3edab5

relocatable-prog: Update documentation. * doc/relocatable-maint.texi (Supporting Relocation): Update to match the recent changes.
author Bruno Haible <bruno@clisp.org>
date Sun, 24 Feb 2019 01:49:15 +0100
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16085
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 #
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
3 # Copyright (C) 2011-2019 Free Software Foundation, Inc.
16085
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 #
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 # This program is free software: you can redistribute it and/or modify
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # the Free Software Foundation; either version 3 of the License, or
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # (at your option) any later version.
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 #
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # GNU General Public License for more details.
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 #
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
16 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16085
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 error=0
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 for module in `./gnulib-tool --list`; do
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 module_license=`./gnulib-tool --extract-license $module`
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 if test "$module_license" = 'GPLed build tool'; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 module_license='GPL'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 for file in `./gnulib-tool --extract-filelist $module | grep '^\(lib\|build-aux\)/'`; do
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 if grep 'GNU General Public' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 if grep 'version 3 or later' $file > /dev/null \
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 || grep 'either version 3' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 file_license='GPL'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 if grep 'version 2 or later' $file > /dev/null \
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 || grep 'either version 2' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 file_license='GPLv2+'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 file_license='GPL??'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 if grep 'Lesser General' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 if grep 'version 3 or later' $file > /dev/null \
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 || grep 'either version 3' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 file_license='LGPL'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 if grep 'version 2 or later' $file > /dev/null \
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 || grep 'version 2 of the License, or' $file > /dev/null \
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 || grep 'version 2\.1 of the License, or' $file > /dev/null; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 file_license='LGPLv2+'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 file_license='LGPL??'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 else
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 file_license='??'
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 if test "$file_license" != "$module_license"; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 if test $error = 0; then
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 echo "Module License File License File name"
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 echo "============== ============== ====================================="
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 printf '%-14s %-14s %s\n' "$module_license" "$file_license" "$file"
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 error=1
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 fi
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 done
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 done
a4c68ff22172 Syntax check for copyright statements.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 exit $error