Lazily convert numeric strings to Lisp numbers in Eshell
[emacs.git] / admin / update-copyright
blob56fdfb862659bf89dc69a8fdec83c153352d9a25
1 #! /bin/sh
2 # Update the copyright dates in Emacs sources.
3 # Typical usage:
5 # admin/update-copyright
7 # By default, this script uses the local-time calendar year.
8 # Set the UPDATE_COPYRIGHT_YEAR environment variable to override the default.
10 # Copyright 2013-2024 Free Software Foundation, Inc.
12 # This file is part of GNU Emacs.
14 # GNU Emacs is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
19 # GNU Emacs is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
27 # written by Paul Eggert
29 # FIXME: The file 'notes/copyright' says that the AIST copyright years
30 # should be updated, but by inspection it appears that some should be
31 # updated and some should not be, due to registration numbers, so
32 # this script leaves these copyright years alone for now.
34 set -o nounset
36 : ${UPDATE_COPYRIGHT_USE_INTERVALS=1}
37 export UPDATE_COPYRIGHT_USE_INTERVALS
39 : ${UPDATE_COPYRIGHT_YEAR=$(date +%Y)}
40 export UPDATE_COPYRIGHT_YEAR
42 emacsver=etc/refcards/emacsver.tex.in
43 sed 's/\\def\\year[{][0-9]*[}]/\\def\\year{'"$UPDATE_COPYRIGHT_YEAR"'}'/g \
44 $emacsver >$emacsver.aux &&
45 { cmp -s $emacsver $emacsver.aux ||
46 cp $emacsver.aux $emacsver
47 } &&
48 rm $emacsver.aux &&
50 repo_files=$(git ls-files) &&
52 # Do not update the copyright of files that have one or more of the
53 # following problems:
54 # . They are license files, maintained by the FSF, with their own dates.
55 # . They are GMP files, maintained by the GMP project, with their own dates.
56 # . Their format cannot withstand changing the contents of copyright strings.
58 updatable_files=$(find $repo_files \
59 ! -name COPYING \
60 ! -name doclicense.texi \
61 ! -name gpl.texi \
62 ! -name '*-gzipped' \
63 ! -name '*.ico' \
64 ! -name '*.icns' \
65 ! -name '*.pbm' \
66 ! -name '*.pdf' \
67 ! -name '*.png' \
68 ! -name '*.sig' \
69 ! -name '*.tar' \
70 ! -name '*.tiff' \
71 ! -name '*.xpm' \
72 ! -name eterm-color \
73 ! -name hand.cur \
74 ! -name key.pub \
75 ! -name key.sec \
76 ! -name 'mini-gmp.[ch]' \
77 -print) &&
79 build-aux/update-copyright $updatable_files
81 printf ">>> Please remember to search for and manually update any\n"
82 printf ">>> copyright years that were not updated by this script.\n"
83 printf ">>> See the file 'admin/notes/years' for details.\n"