annotate libinterp/corefcn/mk-errno-list.sh @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents 0a5b15007766
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
1 #! /bin/sh
29357
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 ########################################################################
29357
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
4 ##
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
5 ## Copyright (C) 2005-2022 The Octave Project Developers
29357
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
7 ## See the file COPYRIGHT.md in the top-level directory of this
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
8 ## distribution or <https://octave.org/copyright/>.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
9 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
10 ## This file is part of Octave.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
11 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
12 ## Octave is free software: you can redistribute it and/or modify it
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
13 ## under the terms of the GNU General Public License as published by
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
14 ## the Free Software Foundation, either version 3 of the License, or
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
15 ## (at your option) any later version.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
16 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
17 ## Octave is distributed in the hope that it will be useful, but
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
20 ## GNU General Public License for more details.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
21 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
22 ## You should have received a copy of the GNU General Public License
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
23 ## along with Octave; see the file COPYING. If not, see
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
24 ## <https://www.gnu.org/licenses/>.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
25 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
26 ########################################################################
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
27
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
28 if [ $# -ne 2 ]; then
23722
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
29 echo "usage: get-errno-list [--perl PERL|--python PYTHON|--sed SED]" 1>&2
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
30 exit 1
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
31 fi
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
32
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
33 if [ $1 = "--perl" ]; then
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 19697
diff changeset
34 PERL="$2"
23419
75a4b9a34999 Ensure generated source files are deterministic and reproducible
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
35 $PERL -e 'foreach $key (sort (keys (%!))) {
23798
771310737137 Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents: 23722
diff changeset
36 $x .= "#if defined ($key)\n { \"$key\", $key },\n#endif\n";
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
37 }
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
38 while (<>) {
23722
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
39 s/^ *\@SYSDEP_ERRNO_LIST\@/$x/;
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
40 s/\@NO_EDIT_WARNING\@/DO NOT EDIT! Generated automatically from oct-errno.in.cc by mk-errno-list.sh/;
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
41 print;
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
42 }'
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
43
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
44 elif [ $1 = "--python" ]; then
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 19697
diff changeset
45 PYTHON="$2"
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
46 $PYTHON -c '
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
47 from errno import errorcode
23419
75a4b9a34999 Ensure generated source files are deterministic and reproducible
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
48 from sys import stdin, stdout
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
49
23798
771310737137 Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents: 23722
diff changeset
50 t = "#if defined (%s)\n { \"%s\", %s },\n#endif\n"
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
51 errstr = ""
23419
75a4b9a34999 Ensure generated source files are deterministic and reproducible
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
52 for v in sorted (errorcode.values ()):
75a4b9a34999 Ensure generated source files are deterministic and reproducible
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
53 errstr += t % tuple (3 * [v])
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
54
23722
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
55 noedit = "DO NOT EDIT! Generated automatically from oct-errno.in.cc by mk-errno-list.sh"
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
56
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
57 repls = ("@SYSDEP_ERRNO_LIST@", errstr), ("@NO_EDIT_WARNING@", noedit)
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
58
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
59 for l in stdin:
23722
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
60 stdout.write (reduce (lambda a, kv: a.replace (*kv), repls, l))
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
61 '
23722
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
62 elif [ $1 = "--sed" ]; then
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
63 SED="$2"
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
64 $SED -e '/@SYSDEP_ERRNO_LIST@/D' \
ab9e51f41a29 substitute no-edit warning in oct-errno.in.cc
John W. Eaton <jwe@octave.org>
parents: 23709
diff changeset
65 -e 's/@NO_EDIT_WARNING@/DO NOT EDIT! Generated automatically from oct-errno.in.cc by mk-errno-list.sh/'
5494
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
66 fi
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
67
73a87a677257 [project @ 2005-10-14 07:29:20 by jwe]
jwe
parents:
diff changeset
68 exit $?