Refer to C23 in place of C2X in glibc
[glibc.git] / scripts / update-copyrights
bloba56cc03f1d9cf3d12e5c3dac6912324cd8d34d7a
1 #!/bin/sh
2 # Update copyright year lists.
3 # Copyright (C) 2012-2024 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <https://www.gnu.org/licenses/>.
20 # Run this script with the first argument being the location of
21 # gnulib's update-copyright script. Any other arguments are ignored.
22 # FSF copyright notices in the glibc source directory containing this
23 # script will be updated; glibc must then be built to update generated
24 # files. Copyright dates in --version copyright notices are not
25 # updated.
27 set -e
29 export LC_ALL=C
30 export UPDATE_COPYRIGHT_FORCE=1
31 export UPDATE_COPYRIGHT_USE_INTERVALS=2
32 export UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
34 update_script=$1
36 if ! [ -f "$update_script" ]; then
37 echo "error: first argument must point to gnulib update-copyright script" >&2
38 exit 1
41 cd "$(dirname "$0")/.."
43 files=$(find . -type f | sed 's|^\./||' | grep -v '^\.git/')
45 for f in $files; do
46 case $f in
47 COPYING | COPYING.LIB | manual/fdl-1.3.texi | manual/lgpl-2.1.texi)
48 # Licenses imported verbatim from FSF sources.
50 manual/texinfo.tex | scripts/config.guess | scripts/config.sub \
51 | scripts/install-sh | scripts/mkinstalldirs | scripts/move-if-change)
52 # Other files imported verbatim from other GNU repositories.
54 po/*.po)
55 # Files imported verbatim from the Translation Project.
57 INSTALL \
58 | locale/programs/charmap-kw.h | locale/programs/locfile-kw.h \
59 | po/libc.pot | sysdeps/gnu/errlist.c)
60 # Generated files.
62 configure | */configure | preconfigure | */preconfigure)
63 # Possibly generated files.
64 if ! [ -f "$f.ac" ]; then
65 "$update_script" "$f"
68 nss/initgroups.c | misc/bits/stab.def | posix/regex.h \
69 | sysdeps/wordsize-32/divdi3.c)
70 # Pre-1991 gaps in copyright years, so cannot use a single range.
71 UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f"
73 csu/version.c | elf/dl-usage.c)
74 # Update the copyright string in the output message.
75 year="$(date +%Y)"
76 sed -i 's/^Copyright (C) [0-9]\{4\} /Copyright (C) '"$year"' /' $f
77 "$update_script" "$f"
80 "$update_script" "$f"
82 esac
83 done