Mercurial > emacs
annotate admin/admin.el @ 86298:a75958448281
*** empty log message ***
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 22 Nov 2007 04:19:48 +0000 |
parents | 4fbadbd4abb0 |
children | 09f5a2d2bbcf |
rev | line source |
---|---|
40063 | 1 ;;; admin.el --- utilities for Emacs administration |
2 | |
75348 | 3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
4 ;; Free Software Foundation, Inc. | |
40063 | 5 |
6 ;; This file is part of GNU Emacs. | |
7 | |
8 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
9 ;; it under the terms of the GNU General Public License as published by | |
78240
450fa81c5930
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
10 ;; the Free Software Foundation; either version 3, or (at your option) |
40063 | 11 ;; any later version. |
12 | |
13 ;; GNU Emacs is distributed in the hope that it will be useful, | |
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 ;; GNU General Public License for more details. | |
17 | |
18 ;; You should have received a copy of the GNU General Public License | |
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64079 | 20 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 ;; Boston, MA 02110-1301, USA. | |
40063 | 22 |
23 ;;; Commentary: | |
24 | |
61547
1926d92f781e
(add-release-logs): Fix require call.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
25 ;; add-release-logs Add ``Version X released'' change log entries. |
1926d92f781e
(add-release-logs): Fix require call.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
26 ;; set-version Change Emacs version number in source tree. |
81229
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
27 ;; set-copyright Change emacs short copyright string (eg as |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
28 ;; printed by --version) in source tree. |
40063 | 29 |
30 ;;; Code: | |
31 | |
32 (defun add-release-logs (root version) | |
33 "Add \"Version VERSION released.\" change log entries in ROOT. | |
34 Root must be the root of an Emacs source tree." | |
35 (interactive "DEmacs root directory: \nNVersion number: ") | |
49298
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
36 (setq root (expand-file-name root)) |
40063 | 37 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
38 (error "%s doesn't seem to be the root of an Emacs source tree" root)) | |
61547
1926d92f781e
(add-release-logs): Fix require call.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
39 (require 'add-log) |
40063 | 40 (let* ((logs (process-lines "find" root "-name" "ChangeLog")) |
41 (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n" | |
49298
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
42 (funcall add-log-time-format) |
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
43 (or add-log-full-name (user-full-name)) |
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
44 (or add-log-mailing-address user-mail-address) |
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
45 version))) |
40063 | 46 (dolist (log logs) |
40084
1f20d08b9da5
(add-release-logs): Put the log entry in lispref, too.
Gerd Moellmann <gerd@gnu.org>
parents:
40063
diff
changeset
|
47 (unless (string-match "/gnus/" log) |
40063 | 48 (find-file log) |
49 (goto-char (point-min)) | |
50 (insert entry))))) | |
51 | |
52 (defun set-version-in-file (root file version rx) | |
53 (find-file (expand-file-name file root)) | |
54 (goto-char (point-min)) | |
55 (unless (re-search-forward rx nil t) | |
56 (error "Version not found in %s" file)) | |
57 (replace-match (format "%s" version) nil nil nil 1)) | |
58 | |
59 (defun set-version (root version) | |
60 "Set Emacs version to VERSION in relevant files under ROOT. | |
61 Root must be the root of an Emacs source tree." | |
40161
795c8ca09f8b
(set-version): Use `s' interactive spec for
Gerd Moellmann <gerd@gnu.org>
parents:
40084
diff
changeset
|
62 (interactive "DEmacs root directory: \nsVersion number: ") |
40063 | 63 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
64 (error "%s doesn't seem to be the root of an Emacs source tree" root)) | |
65 (set-version-in-file root "lisp/version.el" version | |
66 (rx (and "emacs-version" (0+ space) | |
67 ?\" (submatch (1+ (not (in ?\")))) ?\"))) | |
68 (set-version-in-file root "README" version | |
69 (rx (and "version" (1+ space) | |
70 (submatch (1+ (in "0-9.")))))) | |
71 (set-version-in-file root "man/emacs.texi" version | |
72 (rx (and "EMACSVER" (1+ space) | |
63217
3ef574f6b152
(set-version): Set version in lisp manual too.
Lute Kamstra <lute@gnu.org>
parents:
61547
diff
changeset
|
73 (submatch (1+ (in "0-9.")))))) |
3ef574f6b152
(set-version): Set version in lisp manual too.
Lute Kamstra <lute@gnu.org>
parents:
61547
diff
changeset
|
74 (set-version-in-file root "lispref/elisp.texi" version |
3ef574f6b152
(set-version): Set version in lisp manual too.
Lute Kamstra <lute@gnu.org>
parents:
61547
diff
changeset
|
75 (rx (and "EMACSVER" (1+ space) |
65774
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
76 (submatch (1+ (in "0-9.")))))) |
74187
b7548a5c934e
(set-version): Set version number in lib-src/makefile.w32-in.
Juanma Barranquero <lekktu@gmail.com>
parents:
73372
diff
changeset
|
77 (set-version-in-file root "lib-src/makefile.w32-in" version |
b7548a5c934e
(set-version): Set version number in lib-src/makefile.w32-in.
Juanma Barranquero <lekktu@gmail.com>
parents:
73372
diff
changeset
|
78 (rx (and "VERSION" (0+ space) "=" (0+ space) |
b7548a5c934e
(set-version): Set version number in lib-src/makefile.w32-in.
Juanma Barranquero <lekktu@gmail.com>
parents:
73372
diff
changeset
|
79 (submatch (1+ (in "0-9.")))))) |
65774
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
80 ;; nt/emacs.rc also contains the version number, but in an awkward |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
81 ;; format. It must contain four components, separated by commas, and |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
82 ;; in two places those commas are followed by space, in two other |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
83 ;; places they are not. |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
84 (let* ((version-components (append (split-string version "\\.") |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
85 '("0" "0"))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
86 (comma-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
87 (concat (car version-components) "," |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
88 (cadr version-components) "," |
73372
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
89 (cadr (cdr version-components)) "," |
65774
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
90 (cadr (cdr (cdr version-components))))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
91 (comma-space-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
92 (concat (car version-components) ", " |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
93 (cadr version-components) ", " |
73372
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
94 (cadr (cdr version-components)) ", " |
65774
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
95 (cadr (cdr (cdr version-components)))))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
96 (set-version-in-file root "nt/emacs.rc" comma-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
97 (rx (and "FILEVERSION" (1+ space) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
98 (submatch (1+ (in "0-9,")))))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
99 (set-version-in-file root "nt/emacs.rc" comma-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
100 (rx (and "PRODUCTVERSION" (1+ space) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
101 (submatch (1+ (in "0-9,")))))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
102 (set-version-in-file root "nt/emacs.rc" comma-space-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
103 (rx (and "\"FileVersion\"" (0+ space) ?, (0+ space) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
104 ?\" (submatch (1+ (in "0-9, "))) "\\0\""))) |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
105 (set-version-in-file root "nt/emacs.rc" comma-space-version |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
106 (rx (and "\"ProductVersion\"" (0+ space) ?, |
ffd4e3fb1637
(set-version): Set version numbers in nt/emacs.rc.
Jason Rumney <jasonr@gnu.org>
parents:
64079
diff
changeset
|
107 (0+ space) ?\" (submatch (1+ (in "0-9, "))) |
73372
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
108 "\\0\""))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
109 ;; Some files in the "mac" subdirectory also contain the version |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
110 ;; number. |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
111 (set-version-in-file |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
112 root "mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings" |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
113 version (rx (and "CFBundleShortVersionString" (0+ space) ?= (0+ space) ?\" |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
114 (submatch (1+ (in "0-9.")))))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
115 (set-version-in-file |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
116 root "mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings" |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
117 version (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) ?\" |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
118 (submatch (1+ (in "0-9.")))))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
119 (set-version-in-file root "mac/src/Emacs.r" (car version-components) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
120 (rx (and "GNU Emacs " (submatch (1+ (in "0-9"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
121 " for Mac OS"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
122 (set-version-in-file root "mac/src/Emacs.r" (car version-components) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
123 (rx (and (submatch (1+ (in "0-9"))) (0+ space) ?\, |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
124 (0+ space) "/* Major revision in BCD */"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
125 (set-version-in-file root "mac/src/Emacs.r" (cadr version-components) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
126 (rx (and (submatch (1+ (in "0-9"))) (0+ space) ?\, |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
127 (0+ space) "/* Minor revision in BCD */"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
128 (set-version-in-file root "mac/src/Emacs.r" (cadr (cdr version-components)) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
129 (rx (and (submatch (1+ (in "0-9"))) (0+ space) ?\, |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
130 (0+ space) "/* Non-final release # */"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
131 (set-version-in-file root "mac/src/Emacs.r" version |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
132 (rx (and (submatch (1+ (in "0-9."))) (0+ space) ?\" ?\, |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
133 (0+ space) "/* Short version number */"))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
134 (set-version-in-file root "mac/src/Emacs.r" version |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
135 (rx (and "/* Short version number */" (0+ space) ?\" |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
136 (submatch (1+ (in "0-9.")))))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
137 (let* ((third-component (string-to-number (cadr (cdr version-components)))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
138 (release (cond ((>= third-component 90) "alpha") |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
139 ((>= third-component 50) "development") |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
140 (t "final")))) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
141 (set-version-in-file |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
142 root "mac/src/Emacs.r" release |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
143 (rx (and (submatch (1+ (in "a-z"))) (0+ space) ?\, (0+ space) |
726551ae0c3e
(set-version): Set version numbers in "mac" subdirectory.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65774
diff
changeset
|
144 "/* development, alpha, beta, or final (release) */")))))) |
49298
bb7bf9ff7c97
(add-release-logs): Expand the directory name before calling find(1).
Francesco Potortì <pot@gnu.org>
parents:
40161
diff
changeset
|
145 |
81229
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
146 ;; Note this makes some assumptions about form of short copyright. |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
147 (defun set-copyright (root copyright) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
148 "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
149 Root must be the root of an Emacs source tree." |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
150 (interactive (list |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
151 (read-directory-name "Emacs root directory: " nil nil t) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
152 (read-string |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
153 "Short copyright string: " |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
154 (format "Copyright (C) %s Free Software Foundation, Inc." |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
155 (format-time-string "%Y"))))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
156 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
157 (error "%s doesn't seem to be the root of an Emacs source tree" root)) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
158 (set-version-in-file root "lisp/version.el" copyright |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
159 (rx (and "emacs-copyright" (0+ space) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
160 ?\" (submatch (1+ (not (in ?\")))) ?\"))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
161 (set-version-in-file root "lib-src/etags.c" copyright |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
162 (rx (and "emacs_copyright" (0+ (not (in ?\"))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
163 ?\" (submatch (1+ (not (in ?\")))) ?\"))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
164 (set-version-in-file root "lib-src/rcs2log" copyright |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
165 (rx (and "Copyright" (0+ space) ?= (0+ space) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
166 ?\' (submatch (1+ nonl))))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
167 (set-version-in-file |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
168 root "mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings" |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
169 copyright (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) ?\" |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
170 (1+ anything) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
171 (submatch "Copyright" (1+ (not (in ?\"))))))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
172 ;; This one is a nuisance, as it needs to be split over two lines. |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
173 (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
174 (let ((csign "\\0xa9") |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
175 (cyear (match-string 1 copyright)) ; "Copyright (C) 2007 " |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
176 (owner (match-string 2 copyright))) ; "Free Software Foundation, Inc." |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
177 (set-version-in-file root "mac/src/Emacs.r" |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
178 (regexp-quote |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
179 (replace-regexp-in-string "(C)" |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
180 (regexp-quote csign) cyear)) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
181 (rx (and |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
182 (submatch "Copyright" (0+ space) (eval csign) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
183 (0+ space) (= 4 num) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
184 (0+ (not (in ?\")))) ?\"))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
185 (set-version-in-file root "mac/src/Emacs.r" owner |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
186 (rx (and ?\" |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
187 (submatch (1+ (not (in ?\")))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
188 ?\" (0+ space) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
189 "/* Long version number */"))))) |
fd5ff936aab8
(set-copyright): New function.
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
190 |
82926 | 191 (provide 'admin) |
192 | |
52401 | 193 ;;; arch-tag: 4ea83636-2293-408b-884e-ad64f22a3bf5 |
40063 | 194 ;; admin.el ends here. |