comparison lisp/build-report.el @ 442:abe6d1db359e r21-2-36

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