428
|
1 ;;; build-report.el --- Automatically formatted build reports for XEmacs
|
|
2
|
501
|
3 ;; Copyright (C) 1997-2001 Adrian Aichner
|
428
|
4
|
434
|
5 ;; Author: Adrian Aichner <adrian@xemacs.org>
|
428
|
6 ;; Keywords: internal
|
|
7
|
|
8 ;; This file is part of XEmacs.
|
|
9
|
|
10 ;; XEmacs is free software; you can redistribute it and/or modify
|
|
11 ;; it under the terms of the GNU General Public License as published by
|
|
12 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
13 ;; any later version.
|
|
14
|
|
15 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18 ;; General Public License for more details.
|
|
19
|
|
20 ;; You should have received a copy of the GNU General Public License
|
|
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
23 ;; 02111-1307, USA.
|
|
24
|
|
25 ;;; Synched up with: Not synched.
|
|
26
|
|
27 ;;; Commentary:
|
|
28
|
|
29 ;; The Idea:
|
|
30 ;; Let XEmacs report interesting aspects of how it was built.
|
|
31
|
|
32 ;; The Concept:
|
|
33 ;; User creates an XEmacs Build Report by just calling
|
|
34 ;; M-x build-report
|
|
35 ;; which will initialize a mail buffer with relevant information
|
|
36 ;; derived from the XEmacs build process. Point is left at the
|
|
37 ;; beginning of the report for user to input some personal notes and
|
|
38 ;; send the report.
|
|
39
|
|
40 ;; The Status:
|
|
41 ;; This is the first `Proof of Concept'.
|
|
42
|
|
43 ;; The Author:
|
|
44 ;; Adrian Aichner, Teradyne GmbH Munich, Sun., Apr. 20, 1997.
|
|
45
|
|
46 ;;; Code:
|
|
47
|
|
48 (require 'config)
|
442
|
49 (require 'custom)
|
|
50 (require 'cl)
|
428
|
51 (provide 'build-report)
|
|
52
|
442
|
53 ;;; Constant definitions used internally by `build-report'. These are not
|
|
54 ;;; anticipated to be changed by users of `build-report'.
|
|
55 ;;; If users do need to change the value of any of these, they need to do
|
|
56 ;;; it after `build-report' has been loaded (not just required). Please
|
|
57 ;;; report it to the maintainers of `build-report' when you think you
|
|
58 ;;; need to do this.
|
|
59 (defconst build-report-installation-version-regexp
|
975
|
60 "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+\\(.*\\)?configured\\s-+for\\s-+`\\(.+\\)'\\."
|
442
|
61 "*REGEXP matching XEmacs Beta Version string in
|
|
62 `build-report-installation-file' file. This variable is used by
|
|
63 `build-report-installation-data'.")
|
|
64
|
|
65 (defconst build-report-version-file-regexp
|
|
66 "emacs_major_version\\s-*=\\s-*\\([0-9]+\\)
|
|
67 emacs_minor_version\\s-*=\\s-*\\([0-9]+\\)
|
|
68 emacs_beta_version\\s-*=\\s-*\\([0-9]+\\)?
|
975
|
69 xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\"
|
|
70 xemacs_extra_name\\s-*=\\s-*\"\\([^\"]+\\)\""
|
442
|
71 "*REGEXP matching XEmacs Beta Version variable assignments in
|
|
72 `build-report-version-file' file. This variable is used by
|
|
73 `build-report-version-file-data'.")
|
|
74
|
|
75 (defconst build-report-installation-srcdir-regexp
|
|
76 "\\s-*Where should the build process find the source code\\?\\s-*\\(.*\\)$"
|
|
77 "REGEXP matching XEmacs Beta srcdir as the first substring match in
|
|
78 `build-report-installation-file' file. This variable is used by
|
|
79 `build-report-installation-data'.")
|
|
80
|
|
81 ;;; Customization support for build-report starts here.
|
428
|
82
|
|
83 (defgroup build-report nil
|
442
|
84 "Standardizes the Creation of XEmacs Build Reports."
|
|
85 :load 'build-report
|
428
|
86 :group 'build)
|
|
87
|
|
88 (defcustom build-report-destination
|
460
|
89 (list
|
|
90 "XEmacs Build Reports List <xemacs-buildreports@xemacs.org>"
|
|
91 "XEmacs Beta List <xemacs-beta@xemacs.org>")
|
442
|
92 "*The list of mail addresses XEmacs Build Reports should most likely
|
|
93 go to."
|
|
94 :type '(repeat
|
|
95 :custom-show t
|
|
96 :documentation-shown t
|
|
97 string)
|
428
|
98 :group 'build-report)
|
|
99
|
|
100 (defcustom build-report-keep-regexp
|
460
|
101 (list
|
|
102 "^\\(cd\\|n?make\\)\\s-"
|
|
103 "errors?"
|
|
104 "warnings?"
|
|
105 "pure.*\\(space\\|size\\)"
|
|
106 "hides\\b"
|
|
107 "strange"
|
|
108 "shadowings"
|
|
109 "^Compil\\(ing\\s-+in\\|ation\\)"
|
|
110 "^Using"
|
|
111 "not\\s-+found"
|
|
112 "^While\\s-+compiling.*\\(\n\\s-+.+\\)*"
|
|
113 "^Note:"
|
|
114 "Installing"
|
|
115 "[Ff]ile(s) copied"
|
|
116 "\\s-+tests\\s-+")
|
442
|
117 "*Regexp of make process output lines to keep in the report."
|
|
118 :type '(repeat
|
|
119 :custom-show t
|
|
120 :documentation-shown t
|
|
121 regexp)
|
428
|
122 :group 'build-report)
|
|
123
|
|
124 (defcustom build-report-delete-regexp
|
460
|
125 (list
|
|
126 "confl.*with.*auto-inlining"
|
|
127 "^Formatting:"
|
|
128 "(100%) tests successful")
|
442
|
129 "*Regexp of make process output lines to delete from the report."
|
|
130 :type '(repeat
|
|
131 :custom-show t
|
|
132 :documentation-shown t
|
|
133 regexp)
|
428
|
134 :group 'build-report)
|
|
135
|
442
|
136 (defcustom build-report-make-output-dir
|
|
137 (cond
|
|
138 ((equal system-type 'windows-nt)
|
|
139 (expand-file-name "nt"
|
|
140 (gethash 'blddir (config-value-hash-table))))
|
|
141 (t
|
|
142 (gethash 'blddir (config-value-hash-table))))
|
|
143 "*Directory where the build report file is found.
|
|
144 If this is empty or nil, the default, it is replaced by the value of
|
|
145 the XEmacs build directory."
|
|
146 :type '(directory
|
|
147 :custom-show t
|
|
148 :documentation-shown t)
|
|
149 :group 'build-report)
|
|
150
|
|
151 (defcustom build-report-make-output-files
|
460
|
152 (list
|
|
153 "beta.err"
|
|
154 "xemacs-make-all.err"
|
|
155 "xemacs-make-check-temacs.err"
|
|
156 "xemacs-make-check.err"
|
|
157 "xemacs-make-install.err")
|
442
|
158 "*List of Filenames where stdout and stderr of XEmacs make process
|
|
159 have been stored. These are relative to
|
|
160 `build-report-make-output-dir`. You'll have to run make with output
|
|
161 redirection or use the `build' XEmacs package to save this output. You
|
|
162 may use following alias
|
|
163
|
428
|
164 alias mk 'make \!* >>&\! \!$.err &'
|
442
|
165
|
501
|
166 under csh, so that you get beta.err when you run `mk beta'."
|
442
|
167 :type '(repeat
|
|
168 :custom-show t
|
|
169 :documentation-shown t
|
|
170 file)
|
428
|
171 :group 'build-report)
|
|
172
|
|
173 (defcustom build-report-installation-file
|
442
|
174 (expand-file-name "Installation"
|
|
175 (gethash 'blddir (config-value-hash-table)))
|
|
176 "*Installation file produced by XEmacs configure process."
|
|
177 :type '(file
|
|
178 :custom-show t
|
|
179 :documentation-shown t)
|
428
|
180 :group 'build-report)
|
|
181
|
442
|
182 (defcustom build-report-version-file
|
|
183 (expand-file-name
|
|
184 "version.sh"
|
|
185 (gethash 'blddir (config-value-hash-table)))
|
|
186 "*version.sh file identifying XEmacs (Beta) Distribution."
|
|
187 :type '(file
|
|
188 :custom-show t
|
|
189 :documentation-shown t)
|
|
190 :group 'build-report)
|
|
191
|
|
192 (defcustom build-report-installation-insert-all
|
|
193 nil
|
|
194 "*Tell build-report to insert the whole Installation file
|
|
195 instead of just the last report."
|
428
|
196 :type 'boolean
|
|
197 :group 'build-report)
|
|
198
|
|
199 (defcustom build-report-subject
|
|
200 (concat "[%s] " emacs-version " on " system-configuration)
|
442
|
201 "*XEmacs Build Report Subject Line. %s-sequences will be substituted
|
|
202 with user input through `build-report' according to
|
|
203 `build-report-prompts' using `format'."
|
|
204 :type '(string
|
|
205 :custom-show t
|
|
206 :documentation-shown t)
|
428
|
207 :group 'build-report)
|
|
208
|
|
209 (defcustom build-report-prompts
|
442
|
210 (quote (("Status?: " ("Success" "Failure"))))
|
|
211 "*XEmacs Build Report Prompt(s). This is a list of prompt-string
|
|
212 lists used by `build-report' in conjunction with
|
|
213 `build-report-subject'. Each list consists of a prompt string
|
|
214 followed by any number of strings which can be chosen via the history
|
|
215 mechanism."
|
|
216 :type '(repeat
|
|
217 :custom-show t
|
|
218 :documentation-shown t
|
|
219 (list
|
|
220 :tag "Prompt"
|
|
221 string
|
|
222 (repeat
|
|
223 :tag "Values"
|
|
224 string)))
|
428
|
225 :group 'build-report)
|
|
226
|
|
227 (defcustom build-report-file-encoding
|
|
228 "7bit"
|
442
|
229 "*XEmacs Build Report File Encoding to be used when MIME support is
|
|
230 available."
|
428
|
231 :group 'build-report)
|
|
232
|
|
233 ;; Symbol Name mappings from TM to SEMI serving as Compatibility
|
|
234 ;; Bandaid
|
|
235 (when (featurep 'mime-setup)
|
|
236 ;; No (defvaralias ...) so far. Thanks to "Didier Verna"
|
442
|
237 ;; <didier@xemacs.org> for reporting my incorrect defvaraliasing of
|
428
|
238 ;; `mime-editor/insert-tag'.
|
|
239 ;; Thanks to Jens-Ulrik Holger Petersen
|
|
240 ;; <petersen@kurims.kyoto-u.ac.jp> for suggesting the conditional
|
|
241 ;; aliasing of SEMI functions.
|
|
242 (unless (fboundp 'mime-edit-content-beginning)
|
|
243 (defalias 'mime-edit-content-beginning 'mime-editor/content-beginning))
|
|
244 (unless (fboundp 'mime-edit-insert-tag)
|
|
245 (defalias 'mime-edit-insert-tag 'mime-editor/insert-tag))
|
|
246 (unless (fboundp 'mime-edit-insert-binary-file)
|
|
247 (defalias 'mime-edit-insert-binary-file
|
|
248 'mime-editor/insert-binary-file)))
|
|
249
|
442
|
250 (defun build-report-make-output-get ()
|
|
251 "Returns the filename the XEmacs make output is saved in."
|
|
252 (interactive)
|
|
253 (if (or (string-equal build-report-make-output-dir "")
|
|
254 (null build-report-make-output-dir))
|
|
255 (mapcar
|
|
256 (function
|
|
257 (lambda (f)
|
|
258 (expand-file-name
|
|
259 f
|
|
260 (file-name-as-directory
|
|
261 (gethash 'blddir (config-value-hash-table))))))
|
|
262 build-report-make-output-files)
|
|
263 (mapcar
|
|
264 (function
|
|
265 (lambda (f)
|
|
266 (expand-file-name
|
|
267 f
|
|
268 (file-name-as-directory build-report-make-output-dir))))
|
|
269 build-report-make-output-files)))
|
|
270
|
|
271 ;;;###autoload
|
428
|
272 (defun build-report (&rest args)
|
462
|
273 "Report build information including Installation and make output.
|
|
274
|
|
275 Prompts for status (usually \"Success\" or \"Failure\"). Then uses
|
|
276 `compose-mail' to create a mail message. The Subject header contains
|
|
277 status and version information. Point is left at the beginning of the
|
|
278 mail text. Add some notes if you like, and send the report.
|
|
279
|
|
280 Looks for Installation and the make output file (`beta.err' by
|
|
281 default, customizable via `build-report-make-output-files') in the
|
|
282 build directory of the running XEmacs by default (customizable via
|
|
283 `build-report-make-output-dir'). The output from make is filtered
|
|
284 through `build-report-keep-regexp' and `build-report-delete-regexp'
|
|
285 before including in the message.
|
|
286
|
|
287 See also `mail-user-agent', `build-report-destination', and
|
|
288 `build-report-installation-file'."
|
442
|
289 ;; `interactive' form returns value for formal parameter `args'.
|
428
|
290 (interactive
|
|
291 (let (prompt
|
442
|
292 hist
|
|
293 arg
|
|
294 (prompts build-report-prompts))
|
428
|
295 (progn
|
|
296 (while prompts
|
442
|
297 (defvar hist)
|
|
298 (setq prompt (caar prompts))
|
|
299 (setq hist (cdar prompts))
|
|
300 ;; `build-report-prompts' used to be a list of lists, the
|
|
301 ;; first element of each list being the prompt, the rest being
|
|
302 ;; the history. The history is now in a separate list. We
|
|
303 ;; better check for that.
|
|
304 (if (listp (car hist))
|
|
305 (setq hist (car hist)))
|
|
306 (setq prompts (cdr prompts))
|
|
307 (setq arg (cons (read-string prompt "" 'hist) arg)))
|
428
|
308 arg)))
|
|
309 (save-excursion
|
442
|
310 (if (file-exists-p build-report-installation-file)
|
|
311 (multiple-value-bind
|
975
|
312 (major minor beta codename extraname configuration)
|
442
|
313 (build-report-installation-data build-report-installation-file)
|
|
314 (setq build-report-subject
|
975
|
315 (format "[%%s] XEmacs %s.%s%s \"%s\" %s %s"
|
|
316 major minor beta codename extraname configuration)))
|
442
|
317 (multiple-value-bind
|
975
|
318 (major minor beta codename extraname)
|
442
|
319 (build-report-version-file-data build-report-version-file)
|
|
320 (setq build-report-subject
|
975
|
321 (format "[%%s] XEmacs %s.%s%s \"%s\" %s %s"
|
|
322 major minor beta codename extraname system-configuration))))
|
428
|
323 (compose-mail
|
442
|
324 ;; `build-report-destination' used to be a single string, so
|
|
325 ;; let's test if we really get a list of destinations.
|
|
326 (if (listp build-report-destination)
|
|
327 (read-string
|
|
328 "Build Report Destination: "
|
|
329 (car build-report-destination)
|
|
330 'build-report-destination)
|
|
331 (read-string
|
|
332 "Build Report Destination: "
|
|
333 build-report-destination)
|
|
334 )
|
428
|
335 (apply 'format build-report-subject args)
|
|
336 nil
|
|
337 nil
|
|
338 nil
|
|
339 nil
|
|
340 nil)
|
442
|
341 (let* ((report-begin (point))
|
|
342 (files (reverse (build-report-make-output-get)))
|
|
343 (file (car files)))
|
|
344 (while file
|
|
345 (if (file-exists-p file)
|
|
346 (insert (build-report-insert-make-output report-begin file))
|
|
347 (insert (format "%s not found!\n" file)))
|
|
348 (insert "\n")
|
|
349 (setq files (cdr files))
|
|
350 (setq file (car files)))
|
|
351 (if (file-exists-p build-report-installation-file)
|
|
352 (insert (build-report-insert-installation-file
|
|
353 report-begin
|
|
354 build-report-installation-insert-all))
|
|
355 (insert (format "%s not found!\n" build-report-installation-file)))
|
|
356 ;;; (when (and (>= major 21) (>= minor 2) (or (null beta) (>= beta 32)))
|
|
357 ;;; (insert "\n")
|
|
358 ;;; (insert (build-report-insert-config-inc report-begin)))
|
|
359 (insert "\n")
|
428
|
360 (insert (build-report-insert-header report-begin))
|
|
361 (goto-char report-begin))))
|
|
362
|
|
363 (defun build-report-insert-header (where)
|
|
364 "Inserts the build-report-header at the point specified by `where'."
|
|
365 (goto-char where)
|
|
366 (with-temp-buffer
|
442
|
367 (insert
|
|
368 (format "
|
|
369 > XEmacs Build Report generated by emacs-version
|
|
370 > %s
|
|
371 > with system-configuration
|
|
372 > %s
|
|
373 > follows:\n\n" emacs-version system-configuration))
|
428
|
374 (buffer-string)))
|
|
375
|
442
|
376 (defun build-report-insert-make-output (where file)
|
|
377 "Inserts the output of the XEmacs Beta make run in the
|
|
378 current buffer at position WHERE.
|
428
|
379 The make process output must have been saved in
|
442
|
380 `build-report-make-output-files' during the XEmacs Beta building."
|
428
|
381 (goto-char where)
|
|
382 (with-temp-buffer
|
442
|
383 (if (file-exists-p file)
|
|
384 (progn
|
|
385 (if (featurep 'mime-setup)
|
|
386 (progn
|
|
387 (mime-edit-insert-tag
|
|
388 "text"
|
|
389 "plain"
|
|
390 (concat
|
|
391 "\nContent-Disposition: attachment;"
|
|
392 " filename=\""
|
|
393 (file-name-nondirectory
|
|
394 file)
|
|
395 "\""))
|
|
396 (mime-edit-insert-binary-file
|
|
397 file
|
|
398 build-report-file-encoding))
|
|
399 (insert-file-contents file))
|
|
400 (when build-report-keep-regexp
|
|
401 (goto-char (point-min))
|
|
402 (delete-non-matching-lines (build-report-keep)))
|
|
403 (when build-report-delete-regexp
|
|
404 (goto-char (point-min))
|
|
405 (delete-matching-lines (build-report-delete)))
|
|
406 (goto-char (point-min))
|
|
407 (if build-report-keep-regexp
|
|
408 (insert
|
|
409 (format
|
|
410 "> keeping lines matching
|
|
411 > \"%s\"
|
|
412 "
|
|
413 (build-report-keep))))
|
|
414 (if build-report-delete-regexp
|
|
415 (insert
|
|
416 (format
|
|
417 "> %sdeleting lines matching
|
|
418 > \"%s\"
|
|
419 "
|
|
420 (if build-report-keep-regexp
|
|
421 "and then "
|
|
422 "")
|
|
423 (build-report-delete))))
|
|
424 (insert "\n")
|
|
425 (goto-char (point-min))
|
|
426 (insert
|
|
427 (format "> Contents of %s\n" file)))
|
|
428 (insert "> " file
|
|
429 " does not exist!\n\n"))
|
428
|
430 (buffer-string)))
|
442
|
431
|
428
|
432 (defun build-report-insert-installation-file (where all)
|
|
433 "Inserts the contents of the `build-report-installation-file'
|
|
434 created by the XEmacs Beta configure process."
|
|
435 (goto-char where)
|
|
436 (with-temp-buffer
|
|
437 (if (file-exists-p build-report-installation-file)
|
442
|
438 (let (file-begin last-configure)
|
|
439 (insert "> Contents of "
|
|
440 build-report-installation-file
|
|
441 ":\n")
|
|
442 (insert
|
|
443 (format
|
|
444 "> (Output from %s of ./configure)\n\n"
|
|
445 (if all "all runs" "most recent run")))
|
|
446 (if (featurep 'mime-setup)
|
|
447 (progn
|
|
448 (mime-edit-insert-tag
|
|
449 "text"
|
|
450 "plain"
|
|
451 (concat
|
|
452 "\nContent-Disposition: attachment;"
|
|
453 " filename=\""
|
|
454 (file-name-nondirectory
|
|
455 build-report-installation-file)
|
|
456 "\""))
|
|
457 (mime-edit-insert-binary-file
|
|
458 build-report-installation-file
|
|
459 build-report-file-encoding)
|
|
460 (setq file-begin (mime-edit-content-beginning)))
|
|
461 (setq file-begin (point))
|
|
462 (insert-file-contents
|
|
463 build-report-installation-file))
|
|
464 (unless all
|
|
465 (setq last-configure
|
|
466 (search-backward-regexp
|
|
467 "^\\(uname.*\\|osversion\\|OS\\):\\s-+" file-begin t))
|
|
468 (if (and file-begin last-configure)
|
|
469 (delete-region file-begin last-configure))))
|
428
|
470 (insert "> " build-report-installation-file
|
442
|
471 " does not exist!\n\n"))
|
428
|
472 (buffer-string)))
|
|
473
|
|
474 (defun build-report-keep ()
|
442
|
475 "Concatenate elements of `build-report-keep-regexp' and a general
|
|
476 MIME tag REGEXP. The result is a REGEXP string matching either of the
|
|
477 REGEXPs in `build-report-keep-regexp' or a general MIME tag REGEXP."
|
428
|
478 (mapconcat #'identity
|
442
|
479 (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|"))
|
428
|
480
|
|
481 (defun build-report-delete ()
|
442
|
482 "Concatenate elements of `build-report-delete-regexp' and a general
|
|
483 MIME tag REGEXP. The result is a REGEXP string matching either of the
|
|
484 REGEXPs in `build-report-delete-regexp' or a general MIME tag REGEXP."
|
|
485 (mapconcat '(lambda (item) item)
|
|
486 build-report-delete-regexp "\\|"))
|
|
487
|
|
488 (defun build-report-installation-data (&optional file)
|
|
489 "Return a list of XEmacs installation data containing MAJOR_NUMBER
|
|
490 MINOR_NUMBER BETA_STRING CODENAME CONFIGURATION SRCDIR from FILE,
|
|
491 which defaults to `build-report-installation-file'."
|
|
492 (interactive "fInstallation file: ")
|
|
493 (unless file
|
|
494 (setq file build-report-installation-file))
|
|
495 (let
|
975
|
496 (major minor beta codename extraname configuration srcdir)
|
442
|
497 (save-window-excursion
|
|
498 (find-file-read-only file)
|
|
499 (goto-char (point-min))
|
|
500 (while (< (point) (point-max))
|
|
501 (cond
|
|
502 ((looking-at build-report-installation-version-regexp)
|
|
503 (goto-char (match-end 0))
|
|
504 (setq major (match-string 1))
|
|
505 (setq minor (match-string 2))
|
|
506 (setq beta (match-string 3))
|
|
507 (setq codename (match-string 6))
|
975
|
508 (setq extraname (match-string 7))
|
|
509 (setq configuration (match-string 8)))
|
442
|
510 ((looking-at build-report-installation-srcdir-regexp)
|
|
511 (goto-char (match-end 0))
|
|
512 (setq srcdir (match-string 1)))
|
|
513 ;; We avoid matching a potentially zero-length string to avoid
|
|
514 ;; infinite looping.
|
|
515 ((looking-at
|
|
516 "^.+$")
|
|
517 (goto-char (match-end 0)))
|
|
518 ((looking-at "\n")
|
|
519 (goto-char (match-end 0)))))
|
975
|
520 (values major minor (or beta "") codename extraname configuration srcdir))))
|
442
|
521
|
|
522 (defun build-report-version-file-data (&optional file)
|
|
523 "Return a list of XEmacs version information containing
|
|
524 MAJOR_NUMBER MINOR_NUMBER BETA_STRING CODENAME from FILE, which
|
|
525 defaults to `build-report-version-file'."
|
|
526 (interactive "fversion.sh file: ")
|
|
527 (unless file
|
|
528 (setq file build-report-version-file))
|
|
529 (let
|
975
|
530 (major minor beta codename extraname)
|
442
|
531 (save-window-excursion
|
|
532 (find-file-read-only file)
|
|
533 (goto-char (point-min))
|
|
534 (while (< (point) (point-max))
|
|
535 (cond
|
|
536 ((looking-at build-report-version-file-regexp)
|
|
537 (goto-char (match-end 0))
|
|
538 (setq major (match-string 1))
|
|
539 (setq minor (match-string 2))
|
|
540 (setq beta (match-string 3))
|
975
|
541 (setq codename (match-string 4))
|
|
542 (setq extraname (match-string 5)))
|
442
|
543 ;; We avoid matching a potentially zero-length string to avoid
|
|
544 ;; infinite looping.
|
|
545 ((looking-at
|
|
546 "^.+$")
|
|
547 (goto-char (match-end 0)))
|
|
548 ((looking-at "\n")
|
|
549 (goto-char (match-end 0)))))
|
975
|
550 (values major minor (or beta "") codename extraname))))
|
428
|
551
|
|
552 ;;; build-report.el ends here
|