197
|
1 ;;; xemacs-build-report.el --- Automatically formatted build reports for XEmacs
|
|
2
|
|
3 ;; Copyright (C) 1997 Adrian Aichner
|
|
4
|
|
5 ;; Author: Adrian Aichner, Teradyne GmbH Munich <aichner@ecf.teradyne.com>
|
|
6 ;; Date: Sun., Apr. 20, 1997.
|
|
7 ;; Version: 1.25
|
|
8 ;; Keywords: internal
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify
|
|
13 ;; it under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
|
26
|
|
27 ;;; Synched up with: Not synched.
|
|
28
|
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; The Idea:
|
|
32 ;; Let XEmacs report interesting aspects of how it was built.
|
|
33
|
|
34 ;; The Concept:
|
|
35 ;; User creates an XEmacs Build Report by just calling
|
|
36 ;; M-x xemacs-create-build-report
|
|
37 ;; which will initialize a mail buffer with relevant information
|
|
38 ;; derived from the XEmacs build process. Point is left at the
|
|
39 ;; beginning of the report for user to input some personal notes and
|
|
40 ;; send the report.
|
|
41
|
|
42 ;; The Status:
|
|
43 ;; This is the first `Proof of Concept'.
|
|
44
|
|
45 ;; The Author:
|
|
46 ;; Adrian Aichner, Teradyne GmbH Munich, Sun., Apr. 20, 1997.
|
|
47
|
|
48 ;;; Code:
|
|
49
|
|
50 (require 'config)
|
|
51 (provide 'xemacs-build-report)
|
|
52
|
|
53 ;; Building the version from the RCS Revision keyword was lifted from
|
|
54 ;; lisp/packages/auto-save.el.
|
|
55 ;; This was later taken out due to recommandation by developers on
|
|
56 ;; xemacs-beta@xemacs.org. Release versions are to be checked out
|
|
57 ;; using `co -u -kv ...'.
|
|
58 (defconst xemacs-build-report-version
|
|
59 "Revision: 1.25"
|
|
60 "Version number of xemacs-build-report.")
|
|
61
|
|
62 (defgroup xemacs-build-report nil
|
203
|
63 "Package automating the process of sending XEmacs Build Reports.")
|
197
|
64
|
|
65 (defcustom xemacs-build-report-destination
|
|
66 "xemacs-beta@xemacs.org"
|
|
67 "The mail address XEmacs Build Reports should go to."
|
|
68 :group 'xemacs-build-report)
|
|
69
|
|
70 (defcustom xemacs-build-report-keep-regexp
|
|
71 "make\\[\\|warn\\|pure.*\\(space\\|size\\)\\|hides\\|shadowings"
|
|
72 "Regexp of make process output lines to keep in the report."
|
|
73 :group 'xemacs-build-report)
|
|
74
|
|
75 (defcustom xemacs-build-report-delete-regexp
|
|
76 "confl.*with.*auto-inlining"
|
|
77 "Regexp of make process output lines to delete from the report."
|
|
78 :group 'xemacs-build-report)
|
|
79
|
|
80 (defcustom xemacs-build-report-make-output-file
|
|
81 (concat (gethash 'blddir (config-value-hash-table)) "/mk.err")
|
|
82 "Filename where stdout and stderr of XEmacs make process have been stored.
|
|
83 mk.err will not be created automatically. You'll have to run make with
|
|
84 output redirection. I use an alias
|
|
85 alias mk 'make \!* >>&\! \!$.err &'
|
|
86 for that, so that I get mk.err went I run mk."
|
|
87 :group 'xemacs-build-report)
|
|
88
|
|
89 (defcustom xemacs-build-report-installation-file
|
|
90 (concat (gethash 'blddir (config-value-hash-table)) "/Installation")
|
|
91 "Installation file produced by XEmacs configure process."
|
|
92 :group 'xemacs-build-report)
|
|
93
|
|
94 (defcustom xemacs-build-report-subject
|
|
95 (concat "Build %s: " emacs-version " on " system-configuration)
|
|
96 "XEmacs Build Report Subject Line. %s-sequences will be substituted
|
|
97 with user input through `xemacs-create-build-report' according to
|
|
98 `xemacs-build-report-prompts' using `format'."
|
|
99 :group 'xemacs-build-report)
|
|
100
|
|
101 (defcustom xemacs-build-report-prompts
|
|
102 '(("Status?: " "Success" "Failure"))
|
|
103 "XEmacs Build Report Prompt(s). This is a list of prompt-string
|
|
104 lists used by `xemacs-create-build-report' in conjunction with
|
|
105 `xemacs-build-report-subject'. Each list consists of a prompt string
|
|
106 followed by any number of strings which can be chosen via the history
|
|
107 mechanism."
|
|
108 :group 'xemacs-build-report)
|
|
109
|
|
110 (defcustom xemacs-build-report-file-encoding
|
|
111 "7bit"
|
|
112 "XEmacs Build Report File Encoding to be used when MIME support is
|
|
113 available."
|
|
114 :group 'xemacs-build-report)
|
|
115
|
|
116 ;; Symbol Name mappings from TM to SEMI serving as
|
|
117 ;; Compatibility Bandaid
|
|
118 ;; If 'mime-editor/version-name is bound, we must be using TM(-edit).
|
|
119 (if (boundp 'mime-editor/version-name)
|
|
120 (progn
|
|
121 ;; No (defvaralias ...) so far. T
|
|
122 ;; Thanks to "Didier Verna" verna@inf.enst.fr for reporting my
|
|
123 ;; incorrect defvaraliasing of `mime-editor/insert-tag'.
|
|
124 (defalias
|
|
125 'mime-edit-insert-tag
|
|
126 'mime-editor/insert-tag)
|
|
127 (defalias
|
|
128 'mime-edit-insert-binary-file
|
|
129 'mime-editor/insert-binary-file)))
|
|
130
|
|
131 (defun xemacs-create-build-report (&rest args)
|
|
132 "Initializes a fresh mail-mode buffer with the contents of XEmacs
|
|
133 Installation file and excerpts from XEmacs make output and errors and
|
|
134 leaves point at the beginning of the mail text. See also
|
|
135 `xemacs-build-report-destination',
|
|
136 `xemacs-build-report-keep-regexp',
|
|
137 `xemacs-build-report-delete-regexp',
|
|
138 `xemacs-build-report-make-output-file' and
|
|
139 `xemacs-build-report-installation-file'."
|
|
140 (interactive
|
|
141 (let (prompt
|
|
142 hist
|
|
143 arg
|
|
144 (prompts xemacs-build-report-prompts))
|
|
145 (progn
|
|
146 (while prompts
|
|
147 (setq prompt (caar prompts))
|
|
148 (setq hist (cdar prompts))
|
|
149 (setq prompts (cdr prompts))
|
|
150 (setq arg (cons (read-string prompt "" 'hist) arg)))
|
|
151 arg)))
|
|
152 (save-excursion
|
|
153 (mail
|
|
154 t
|
|
155 xemacs-build-report-destination
|
|
156 (apply 'format xemacs-build-report-subject args))
|
|
157 (let ((report-begin (mail-text)))
|
|
158 (if (file-exists-p xemacs-build-report-make-output-file)
|
|
159 (progn
|
|
160 (if (featurep 'mime-setup)
|
|
161 (progn
|
|
162 (setq xemacs-build-report-keep-regexp
|
|
163 (concat "^--\\[\\[\\|\\]\\]$\\|"
|
|
164 xemacs-build-report-keep-regexp))
|
|
165 (mime-edit-insert-tag
|
|
166 "application"
|
|
167 "octet-stream"
|
|
168 (concat
|
|
169 "\nContent-Disposition: attachment;"
|
|
170 " filename=\""
|
|
171 (file-name-nondirectory
|
|
172 xemacs-build-report-make-output-file)
|
|
173 "\""))
|
|
174 (mime-edit-insert-binary-file
|
|
175 xemacs-build-report-make-output-file
|
|
176 xemacs-build-report-file-encoding))
|
|
177 (insert-file-contents xemacs-build-report-make-output-file))
|
|
178 (goto-char report-begin)
|
|
179 (delete-non-matching-lines
|
|
180 xemacs-build-report-keep-regexp)
|
|
181 (goto-char report-begin)
|
|
182 (delete-matching-lines xemacs-build-report-delete-regexp)
|
|
183 (goto-char report-begin)
|
|
184 (insert "> Contents of "
|
|
185 xemacs-build-report-make-output-file
|
|
186 "\n> keeping lines matching\n> \""
|
|
187 xemacs-build-report-keep-regexp
|
|
188 "\"\n> and then deleting lines matching\n> \""
|
|
189 xemacs-build-report-delete-regexp
|
|
190 "\"\n\n"))
|
|
191 (insert "> " xemacs-build-report-make-output-file
|
|
192 " does not exist!\n\n"))
|
|
193 (goto-char report-begin)
|
|
194 (insert "\n> XEmacs Build Report as generated\n> by "
|
|
195 "xemacs-build-report-version "
|
|
196 xemacs-build-report-version
|
|
197 " follows:\n\n")
|
|
198 (if (file-exists-p xemacs-build-report-installation-file)
|
|
199 (progn
|
|
200 (insert "> Contents of "
|
|
201 xemacs-build-report-installation-file
|
|
202 ":\n\n")
|
|
203 (if (featurep 'mime-setup)
|
|
204 (progn
|
|
205 (mime-edit-insert-tag
|
|
206 "application"
|
|
207 "octet-stream"
|
|
208 (concat
|
|
209 "\nContent-Disposition: attachment;"
|
|
210 " filename=\""
|
|
211 (file-name-nondirectory
|
|
212 xemacs-build-report-installation-file)
|
|
213 "\""))
|
|
214 (mime-edit-insert-binary-file
|
|
215 xemacs-build-report-installation-file
|
|
216 xemacs-build-report-file-encoding))
|
|
217 (insert-file-contents xemacs-build-report-installation-file)))
|
|
218 (insert "> " xemacs-build-report-installation-file
|
|
219 " does not exist!\n\n"))
|
|
220 (goto-char report-begin))))
|
|
221
|
|
222 ;;; xemacs-build-report.el ends here
|