diff options
| author | Glenn Morris | 2014-05-10 14:59:05 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-05-10 14:59:05 -0700 |
| commit | 732fbcd9d1c0262012e7d405d6519d20a8a5f769 (patch) | |
| tree | d376c7e1e58d712bd6d698f446acd15b57c0bf44 | |
| parent | 6b45ef356516c224e88b410edaab43d4c58f94dc (diff) | |
| download | emacs-732fbcd9d1c0262012e7d405d6519d20a8a5f769.tar.gz emacs-732fbcd9d1c0262012e7d405d6519d20a8a5f769.zip | |
admin.el tweaks
* admin/admin.el (set-version-in-file): Don't set identical version.
(set-version): Provide default version number.
(set-version, set-copyright): Give start/end messages.
| -rw-r--r-- | admin/ChangeLog | 6 | ||||
| -rw-r--r-- | admin/admin.el | 23 |
2 files changed, 22 insertions, 7 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index c1be3dac557..82041f7acfb 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-05-10 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * admin.el (set-version-in-file): Don't set identical version. | ||
| 4 | (set-version): Provide default version number. | ||
| 5 | (set-version, set-copyright): Give start/end messages. | ||
| 6 | |||
| 1 | 2014-04-17 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2014-04-17 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | * notes/bzr: Update instructions for merging from gnulib. | 9 | * notes/bzr: Update instructions for merging from gnulib. |
diff --git a/admin/admin.el b/admin/admin.el index 007cb06e592..7af9ffa4177 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -65,17 +65,25 @@ Optional argument DATE is the release date, default today." | |||
| 65 | "Subroutine of `set-version' and `set-copyright'." | 65 | "Subroutine of `set-version' and `set-copyright'." |
| 66 | (find-file (expand-file-name file root)) | 66 | (find-file (expand-file-name file root)) |
| 67 | (goto-char (point-min)) | 67 | (goto-char (point-min)) |
| 68 | (setq version (format "%s" version)) | ||
| 68 | (unless (re-search-forward rx nil :noerror) | 69 | (unless (re-search-forward rx nil :noerror) |
| 69 | (user-error "Version not found in %s" file)) | 70 | (user-error "Version not found in %s" file)) |
| 70 | (replace-match (format "%s" version) nil nil nil 1)) | 71 | (if (not (equal version (match-string 1))) |
| 72 | (replace-match version nil nil nil 1) | ||
| 73 | (kill-buffer) | ||
| 74 | (message "No need to update `%s'" file))) | ||
| 71 | 75 | ||
| 72 | ;; TODO report the progress | ||
| 73 | (defun set-version (root version) | 76 | (defun set-version (root version) |
| 74 | "Set Emacs version to VERSION in relevant files under ROOT. | 77 | "Set Emacs version to VERSION in relevant files under ROOT. |
| 75 | Root must be the root of an Emacs source tree." | 78 | Root must be the root of an Emacs source tree." |
| 76 | (interactive "DEmacs root directory: \nsVersion number: ") | 79 | (interactive (list |
| 80 | (read-directory-name "Emacs root directory: " source-directory) | ||
| 81 | (read-string "Version number: " | ||
| 82 | (replace-regexp-in-string "\\.[0-9]+\\'" "" | ||
| 83 | emacs-version)))) | ||
| 77 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 84 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 78 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) | 85 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 86 | (message "Setting version numbers...") | ||
| 79 | ;; There's also a "version 3" (standing for GPLv3) at the end of | 87 | ;; There's also a "version 3" (standing for GPLv3) at the end of |
| 80 | ;; `README', but since `set-version-in-file' only replaces the first | 88 | ;; `README', but since `set-version-in-file' only replaces the first |
| 81 | ;; occurrence, it won't be replaced. | 89 | ;; occurrence, it won't be replaced. |
| @@ -158,11 +166,10 @@ Root must be the root of an Emacs source tree." | |||
| 158 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") | 166 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") |
| 159 | (set-version-in-file root "etc/refcards/emacsver.tex" version | 167 | (set-version-in-file root "etc/refcards/emacsver.tex" version |
| 160 | "\\\\def\\\\versionemacs\ | 168 | "\\\\def\\\\versionemacs\ |
| 161 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))) | 169 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))) |
| 162 | 170 | (message "Setting version numbers...done")) | |
| 163 | 171 | ||
| 164 | ;; Note this makes some assumptions about form of short copyright. | 172 | ;; Note this makes some assumptions about form of short copyright. |
| 165 | ;; TODO report the progress | ||
| 166 | (defun set-copyright (root copyright) | 173 | (defun set-copyright (root copyright) |
| 167 | "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. | 174 | "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. |
| 168 | Root must be the root of an Emacs source tree." | 175 | Root must be the root of an Emacs source tree." |
| @@ -174,6 +181,7 @@ Root must be the root of an Emacs source tree." | |||
| 174 | (format-time-string "%Y"))))) | 181 | (format-time-string "%Y"))))) |
| 175 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 182 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 176 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) | 183 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 184 | (message "Setting copyrights...") | ||
| 177 | (set-version-in-file root "configure.ac" copyright | 185 | (set-version-in-file root "configure.ac" copyright |
| 178 | (rx (and bol "copyright" (0+ (not (in ?\"))) | 186 | (rx (and bol "copyright" (0+ (not (in ?\"))) |
| 179 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) | 187 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) |
| @@ -195,7 +203,8 @@ Root must be the root of an Emacs source tree." | |||
| 195 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year") | 203 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year") |
| 196 | (set-version-in-file root "etc/refcards/emacsver.tex" copyright | 204 | (set-version-in-file root "etc/refcards/emacsver.tex" copyright |
| 197 | "\\\\def\\\\year\ | 205 | "\\\\def\\\\year\ |
| 198 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year"))) | 206 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year")) |
| 207 | (message "Setting copyrights...done")) | ||
| 199 | 208 | ||
| 200 | ;;; Various bits of magic for generating the web manuals | 209 | ;;; Various bits of magic for generating the web manuals |
| 201 | 210 | ||