diff options
| author | Glenn Morris | 2007-06-07 07:28:32 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-06-07 07:28:32 +0000 |
| commit | a3045b7ededc0d2e9728dd125999cc7195f654f8 (patch) | |
| tree | 6d780922ed4ee43487a00cfc68b28da3073c7b98 /admin/admin.el | |
| parent | bfcea090da99bb6e99375ad88eca774527442bc4 (diff) | |
| download | emacs-a3045b7ededc0d2e9728dd125999cc7195f654f8.tar.gz emacs-a3045b7ededc0d2e9728dd125999cc7195f654f8.zip | |
(set-copyright): New function.
Diffstat (limited to 'admin/admin.el')
| -rw-r--r-- | admin/admin.el | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/admin/admin.el b/admin/admin.el index 342b40f9bde..175eb6ded1b 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | 24 | ||
| 25 | ;; add-release-logs Add ``Version X released'' change log entries. | 25 | ;; add-release-logs Add ``Version X released'' change log entries. |
| 26 | ;; set-version Change Emacs version number in source tree. | 26 | ;; set-version Change Emacs version number in source tree. |
| 27 | ;; set-copyright Change emacs short copyright string (eg as | ||
| 28 | ;; printed by --version) in source tree. | ||
| 27 | 29 | ||
| 28 | ;;; Code: | 30 | ;;; Code: |
| 29 | 31 | ||
| @@ -158,5 +160,50 @@ Root must be the root of an Emacs source tree." | |||
| 158 | (rx (and (submatch (1+ (in "a-z"))) (0+ space) ?\, (0+ space) | 160 | (rx (and (submatch (1+ (in "a-z"))) (0+ space) ?\, (0+ space) |
| 159 | "/* development, alpha, beta, or final (release) */")))))) | 161 | "/* development, alpha, beta, or final (release) */")))))) |
| 160 | 162 | ||
| 163 | ;; Note this makes some assumptions about form of short copyright. | ||
| 164 | (defun set-copyright (root copyright) | ||
| 165 | "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. | ||
| 166 | Root must be the root of an Emacs source tree." | ||
| 167 | (interactive (list | ||
| 168 | (read-directory-name "Emacs root directory: " nil nil t) | ||
| 169 | (read-string | ||
| 170 | "Short copyright string: " | ||
| 171 | (format "Copyright (C) %s Free Software Foundation, Inc." | ||
| 172 | (format-time-string "%Y"))))) | ||
| 173 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | ||
| 174 | (error "%s doesn't seem to be the root of an Emacs source tree" root)) | ||
| 175 | (set-version-in-file root "lisp/version.el" copyright | ||
| 176 | (rx (and "emacs-copyright" (0+ space) | ||
| 177 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) | ||
| 178 | (set-version-in-file root "lib-src/etags.c" copyright | ||
| 179 | (rx (and "emacs_copyright" (0+ (not (in ?\"))) | ||
| 180 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) | ||
| 181 | (set-version-in-file root "lib-src/rcs2log" copyright | ||
| 182 | (rx (and "Copyright" (0+ space) ?= (0+ space) | ||
| 183 | ?\' (submatch (1+ nonl))))) | ||
| 184 | (set-version-in-file | ||
| 185 | root "mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings" | ||
| 186 | copyright (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) ?\" | ||
| 187 | (1+ anything) | ||
| 188 | (submatch "Copyright" (1+ (not (in ?\"))))))) | ||
| 189 | ;; This one is a nuisance, as it needs to be split over two lines. | ||
| 190 | (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) | ||
| 191 | (let ((csign "\\0xa9") | ||
| 192 | (cyear (match-string 1 copyright)) ; "Copyright (C) 2007 " | ||
| 193 | (owner (match-string 2 copyright))) ; "Free Software Foundation, Inc." | ||
| 194 | (set-version-in-file root "mac/src/Emacs.r" | ||
| 195 | (regexp-quote | ||
| 196 | (replace-regexp-in-string "(C)" | ||
| 197 | (regexp-quote csign) cyear)) | ||
| 198 | (rx (and | ||
| 199 | (submatch "Copyright" (0+ space) (eval csign) | ||
| 200 | (0+ space) (= 4 num) | ||
| 201 | (0+ (not (in ?\")))) ?\"))) | ||
| 202 | (set-version-in-file root "mac/src/Emacs.r" owner | ||
| 203 | (rx (and ?\" | ||
| 204 | (submatch (1+ (not (in ?\")))) | ||
| 205 | ?\" (0+ space) | ||
| 206 | "/* Long version number */"))))) | ||
| 207 | |||
| 161 | ;;; arch-tag: 4ea83636-2293-408b-884e-ad64f22a3bf5 | 208 | ;;; arch-tag: 4ea83636-2293-408b-884e-ad64f22a3bf5 |
| 162 | ;; admin.el ends here. | 209 | ;; admin.el ends here. |