aboutsummaryrefslogtreecommitdiffstats
path: root/admin/admin.el
diff options
context:
space:
mode:
authorGlenn Morris2014-11-22 14:04:32 -0800
committerGlenn Morris2014-11-22 14:07:48 -0800
commit84e2f13cd50a7ef6af736559107f0a8e6bcec6c5 (patch)
treec8b5f5424908cc820cc8e51c1669e889b15f3d7c /admin/admin.el
parent239cd5b62759b23020cb308d993b7e26933943d7 (diff)
downloademacs-84e2f13cd50a7ef6af736559107f0a8e6bcec6c5.tar.gz
emacs-84e2f13cd50a7ef6af736559107f0a8e6bcec6c5.zip
Further reduce number of versioned files storing Emacs version number.
* configure.ac (comma_version, comma_space_version) [mingw32]: New output variables. (nt/emacs.rc, nt/emacsclient.rc) [mingw32]: New output files. * make-dist: Update nt/ for *.rc -> *.rc.in changes. * nt/emacs.rc.in, nt/emacsclient.rc.in: Rename from nt/emacs.rc, emacsclient.rc. Let configure generate the real files, and set the version numbers. * lib-src/Makefile.in (emacsclient.res): Update deps for nt/emacsclient.rc now being in the build directory, not the source directory. * nt/Makefile.in (distclean): Delete *.rc. (emacs.res): Update deps for nt/emacsclient.rc now being in the build directory, not the source directory. * admin/admin.el (set-version): No more need to update nt/*.rc. * admin/authors.el (authors-renamed-files-alist): Add .rc.in files.
Diffstat (limited to 'admin/admin.el')
-rw-r--r--admin/admin.el45
1 files changed, 2 insertions, 43 deletions
diff --git a/admin/admin.el b/admin/admin.el
index b22160ef478..d6c702a3bdf 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -99,6 +99,8 @@ Root must be the root of an Emacs source tree."
99 (rx (and bol "#" (0+ blank) "define" (1+ blank) 99 (rx (and bol "#" (0+ blank) "define" (1+ blank)
100 "VERSION" (1+ blank) "\"" 100 "VERSION" (1+ blank) "\""
101 (submatch (1+ (in "0-9.")))))) 101 (submatch (1+ (in "0-9."))))))
102 ;; TODO: msdos could easily extract the version number from
103 ;; configure.ac with sed, rather than duplicating the information.
102 (set-version-in-file root "msdos/sed2v2.inp" version 104 (set-version-in-file root "msdos/sed2v2.inp" version
103 (rx (and bol "/^#undef " (1+ not-newline) 105 (rx (and bol "/^#undef " (1+ not-newline)
104 "define VERSION" (1+ space) "\"" 106 "define VERSION" (1+ space) "\""
@@ -107,49 +109,6 @@ Root must be the root of an Emacs source tree."
107 (set-version-in-file root "nt/makefile.w32-in" version 109 (set-version-in-file root "nt/makefile.w32-in" version
108 (rx (and "VERSION" (0+ space) "=" (0+ space) 110 (rx (and "VERSION" (0+ space) "=" (0+ space)
109 (submatch (1+ (in "0-9.")))))) 111 (submatch (1+ (in "0-9."))))))
110 ;; nt/emacs.rc also contains the version number, but in an awkward
111 ;; format. It must contain four components, separated by commas, and
112 ;; in two places those commas are followed by space, in two other
113 ;; places they are not.
114 (let* ((version-components (append (split-string version "\\.")
115 '("0" "0")))
116 (comma-version
117 (concat (car version-components) ","
118 (cadr version-components) ","
119 (cadr (cdr version-components)) ","
120 (cadr (cdr (cdr version-components)))))
121 (comma-space-version
122 (concat (car version-components) ", "
123 (cadr version-components) ", "
124 (cadr (cdr version-components)) ", "
125 (cadr (cdr (cdr version-components))))))
126 (set-version-in-file root "nt/emacs.rc" comma-version
127 (rx (and "FILEVERSION" (1+ space)
128 (submatch (1+ (in "0-9,"))))))
129 (set-version-in-file root "nt/emacs.rc" comma-version
130 (rx (and "PRODUCTVERSION" (1+ space)
131 (submatch (1+ (in "0-9,"))))))
132 (set-version-in-file root "nt/emacs.rc" comma-space-version
133 (rx (and "\"FileVersion\"" (0+ space) ?, (0+ space)
134 ?\" (submatch (1+ (in "0-9, "))) "\\0\"")))
135 (set-version-in-file root "nt/emacs.rc" comma-space-version
136 (rx (and "\"ProductVersion\"" (0+ space) ?,
137 (0+ space) ?\" (submatch (1+ (in "0-9, ")))
138 "\\0\"")))
139 ;; Likewise for emacsclient.rc
140 (set-version-in-file root "nt/emacsclient.rc" comma-version
141 (rx (and "FILEVERSION" (1+ space)
142 (submatch (1+ (in "0-9,"))))))
143 (set-version-in-file root "nt/emacsclient.rc" comma-version
144 (rx (and "PRODUCTVERSION" (1+ space)
145 (submatch (1+ (in "0-9,"))))))
146 (set-version-in-file root "nt/emacsclient.rc" comma-space-version
147 (rx (and "\"FileVersion\"" (0+ space) ?, (0+ space)
148 ?\" (submatch (1+ (in "0-9, "))) "\\0\"")))
149 (set-version-in-file root "nt/emacsclient.rc" comma-space-version
150 (rx (and "\"ProductVersion\"" (0+ space) ?,
151 (0+ space) ?\" (submatch (1+ (in "0-9, ")))
152 "\\0\"")))
153 ;; Major version only. 112 ;; Major version only.
154 (when (string-match "\\([0-9]\\{2,\\}\\)" version) 113 (when (string-match "\\([0-9]\\{2,\\}\\)" version)
155 (setq version (match-string 1 version)) 114 (setq version (match-string 1 version))