Commit | Line | Data |
---|---|---|
9ebada6a PE |
1 | #! /bin/sh |
2 | # Update the copyright dates in Emacs sources. | |
3 | # Typical usage: | |
4 | # | |
5 | # admin/update-copyright | |
6 | # | |
7 | # By default, this script uses the local-time calendar year. | |
8 | # Set the UPDATE_COPYRIGHT_YEAR environment variable to override the default. | |
9 | ||
ba318903 | 10 | # Copyright 2013-2014 Free Software Foundation, Inc. |
9ebada6a PE |
11 | |
12 | # This file is part of GNU Emacs. | |
13 | ||
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. | |
18 | ||
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. | |
23 | ||
24 | # You should have received a copy of the GNU General Public License | |
25 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
26 | ||
27 | # written by Paul Eggert | |
28 | ||
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. | |
33 | ||
34 | : ${UPDATE_COPYRIGHT_USE_INTERVALS=1} | |
35 | export UPDATE_COPYRIGHT_USE_INTERVALS | |
36 | ||
37 | : ${UPDATE_COPYRIGHT_YEAR=$(date +%Y)} | |
38 | export UPDATE_COPYRIGHT_YEAR | |
39 | ||
40 | emacsver=etc/refcards/emacsver.tex | |
41 | sed 's/\\def\\year[{][0-9]*[}]/\\def\\year{'"$UPDATE_COPYRIGHT_YEAR"'}'/g \ | |
42 | $emacsver >$emacsver.aux && | |
43 | { cmp -s $emacsver $emacsver.aux || | |
44 | cp $emacsver.aux $emacsver | |
45 | } && | |
46 | rm $emacsver.aux && | |
47 | ||
48 | bzr_files=$(bzr ls -RV --kind file) && | |
49 | ||
50 | # Do not update the copyright of files that have one or more of the | |
51 | # following problems: | |
52 | # . They are license files, maintained by the FSF, with their own dates. | |
53 | # . Their format cannot withstand changing the contents of copyright strings. | |
54 | ||
55 | updatable_files=$(find $bzr_files \ | |
56 | ! -name COPYING \ | |
57 | ! -name doclicense.texi \ | |
58 | ! -name gpl.texi \ | |
59 | ! -name '*-gzipped' \ | |
60 | ! -name '*.ico' \ | |
61 | ! -name '*.icns' \ | |
62 | ! -name '*.pbm' \ | |
63 | ! -name '*.pdf' \ | |
64 | ! -name '*.png' \ | |
65 | ! -name '*.sig' \ | |
66 | ! -name '*.tar' \ | |
67 | ! -name '*.tiff' \ | |
68 | ! -name '*.xpm' \ | |
69 | ! -name eterm-color \ | |
70 | ! -name hand.cur \ | |
71 | ! -name key.pub \ | |
72 | ! -name key.sec \ | |
73 | -print) && | |
74 | ||
75 | build-aux/update-copyright $updatable_files |