| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Update copyright year lists. |
| 3 | # Copyright (C) 2012-2026 Free Software Foundation, Inc. |
| 4 | # This file is part of the GNU C Library. |
| 5 | |
| 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. |
| 10 | |
| 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. |
| 15 | |
| 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/>. |
| 19 | |
| 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. |
| 26 | |
| 27 | set -e |
| 28 | |
| 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 |
| 33 | |
| 34 | update_script=$1 |
| 35 | |
| 36 | if ! [scip-shell system . . `[`. -f "$update_script" ]; then |
| 37 | echoscip-shell system . . echo. "error: first argument must point to gnulib update-copyright script" >&2 |
| 38 | exit 1 |
| 39 | fi |
| 40 | |
| 41 | cd "$(dirnamescip-shell system . . dirname. "$0")/.." |
| 42 | |
| 43 | files=$(findscip-shell system . . find. . -type f | sedscip-shell system . . sed. 's|^\./||' | grepscip-shell system . . grep. -v '^\.git/') |
| 44 | |
| 45 | for f in $files; do |
| 46 | case $f in |
| 47 | COPYING* | manual/fdl-1.3.texi | manual/lgpl-2.1.texi) |
| 48 | # Licenses imported verbatim from FSF sources. |
| 49 | ;; |
| 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. |
| 53 | ;; |
| 54 | po/*.po) |
| 55 | # Files imported verbatim from the Translation Project. |
| 56 | ;; |
| 57 | support/bundled/linux/LICENSES/*) |
| 58 | # Files imported verbatim from Linux kernel sources. |
| 59 | ;; |
| 60 | INSTALL \ |
| 61 | | locale/programs/charmap-kw.h | locale/programs/locfile-kw.h \ |
| 62 | | po/libc.pot | sysdeps/gnu/errlist.c) |
| 63 | # Generated files. |
| 64 | ;; |
| 65 | configure | */configure | preconfigure | */preconfigure) |
| 66 | # Possibly generated files. |
| 67 | if ! [scip-shell system . . `[`. -f "$f.ac" ]; then |
| 68 | "$update_script" "$f" |
| 69 | fi |
| 70 | ;; |
| 71 | nss/initgroups.c | misc/bits/stab.def | posix/regex.h \ |
| 72 | | sysdeps/wordsize-32/divdi3.c) |
| 73 | # Pre-1991 gaps in copyright years, so cannot use a single range. |
| 74 | UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f" |
| 75 | ;; |
| 76 | csu/version.c | elf/dl-usage.c) |
| 77 | # Update the copyright string in the output message. |
| 78 | year="$(datescip-shell system . . date. +%Y)" |
| 79 | sedscip-shell system . . sed. -i 's/^Copyright (C) [0-9]\{4\} /Copyright (C) '"$year"' /' $f |
| 80 | "$update_script" "$f" |
| 81 | ;; |
| 82 | *) |
| 83 | "$update_script" "$f" |
| 84 | ;; |
| 85 | esac |
| 86 | done |