annotate lisp/build-report.el @ 428:3ecd8885ac67 r21-2-22

Import from CVS: tag r21-2-22
author cvs
date Mon, 13 Aug 2007 11:28:15 +0200
parents
children 9d177e8d4150
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; build-report.el --- Automatically formatted build reports for XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Adrian Aichner
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Author: Adrian Aichner, Teradyne GmbH Munich <aichner@ecf.teradyne.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Date: Sun., Apr. 20, 1997.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Version: 1.35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;; Synched up with: Not synched.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; The Idea:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;; Let XEmacs report interesting aspects of how it was built.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;; The Concept:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 ;; User creates an XEmacs Build Report by just calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 ;; M-x build-report
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 ;; which will initialize a mail buffer with relevant information
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ;; derived from the XEmacs build process. Point is left at the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 ;; beginning of the report for user to input some personal notes and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 ;; send the report.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 ;; The Status:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 ;; This is the first `Proof of Concept'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 ;; The Author:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 ;; Adrian Aichner, Teradyne GmbH Munich, Sun., Apr. 20, 1997.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 (require 'config)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 (provide 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 ;; Due to recommendation by developers on xemacs-beta@xemacs.org,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 ;; release versions are to be checked out using `co -u -kv ...'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 (defconst build-report-version
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 "1.35"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 "Version number of build-report.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 (defgroup build-report nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 "Package automating the process of sending XEmacs Build Reports."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 :group 'build)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (defcustom build-report-destination
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 "xemacs-build-reports@xemacs.org"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 "The mail address XEmacs Build Reports should go to."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 :type 'string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 (defcustom build-report-keep-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 "make\\["
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 "error"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 "warn"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 "pure.*\\(space\\|size\\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 "hides\\b"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 "strange"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 "shadowings"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 "^Compilation"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 "not\\s-+found")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 "Regexp of make process output lines to keep in the report."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 :type '(repeat regexp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 (defcustom build-report-delete-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 (list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 "confl.*with.*auto-inlining"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 (concat (regexp-quote (gethash 'blddir (config-value-hash-table))) "/lisp/[^ \t\n]+ hides "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 "Regexp of make process output lines to delete from the report."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 :type '(repeat regexp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 (defcustom build-report-make-output-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (concat (gethash 'blddir (config-value-hash-table)) "/beta.err")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 "Filename where stdout and stderr of XEmacs make process have been stored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 mk.err will not be created automatically. You'll have to run make with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 output redirection. I use an alias
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 alias mk 'make \!* >>&\! \!$.err &'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 for that, so that I get beta.err went I run `mk beta'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 :type 'file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (defcustom build-report-installation-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 (concat (gethash 'blddir (config-value-hash-table)) "/Installation")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 "Installation file produced by XEmacs configure process."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 :type 'file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (defcustom build-report-installation-insert-all nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 "Tell build-report to insert the whole Installation file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 instead of just the last report."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 :type 'boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (defcustom build-report-subject
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 (concat "[%s] " emacs-version " on " system-configuration)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 "XEmacs Build Report Subject Line. %s-sequences will be substituted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 with user input through `build-report' according to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 `build-report-prompts' using `format'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 :type 'string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 (defcustom build-report-prompts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 '(("Status?: " "Success" "Failure"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 "XEmacs Build Report Prompt(s). This is a list of prompt-string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 lists used by `build-report' in conjunction with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 `build-report-subject'. Each list consists of a prompt string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 followed by any number of strings which can be chosen via the history
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 mechanism."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 (defcustom build-report-file-encoding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 "7bit"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 "XEmacs Build Report File Encoding to be used when MIME support is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 available."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 ;; Symbol Name mappings from TM to SEMI serving as Compatibility
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 ;; Bandaid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (when (featurep 'mime-setup)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 ;; No (defvaralias ...) so far. Thanks to "Didier Verna"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 ;; <verna@inf.enst.fr> for reporting my incorrect defvaraliasing of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 ;; `mime-editor/insert-tag'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 ;; Thanks to Jens-Ulrik Holger Petersen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 ;; <petersen@kurims.kyoto-u.ac.jp> for suggesting the conditional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 ;; aliasing of SEMI functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (unless (fboundp 'mime-edit-content-beginning)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 (defalias 'mime-edit-content-beginning 'mime-editor/content-beginning))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (unless (fboundp 'mime-edit-insert-tag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (defalias 'mime-edit-insert-tag 'mime-editor/insert-tag))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (unless (fboundp 'mime-edit-insert-binary-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 (defalias 'mime-edit-insert-binary-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 'mime-editor/insert-binary-file)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (defun build-report (&rest args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 "Initializes a fresh mail composition buffer using `compose-mail'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 with the contents of XEmacs Installation file and excerpts from XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 make output and errors and leaves point at the beginning of the mail text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 See also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 `compose-mail', `mail-user-agent',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 `build-report-destination',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 `build-report-keep-regexp',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 `build-report-delete-regexp',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 `build-report-make-output-file' and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 `build-report-installation-file'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 (interactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 (let (prompt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 hist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 arg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (prompts build-report-prompts))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 (while prompts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 (defvar hist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (setq prompt (caar prompts))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (setq hist (cdar prompts))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 (setq prompts (cdr prompts))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 (setq arg (cons (read-string prompt "" 'hist) arg)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 arg)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 (compose-mail
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 build-report-destination
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 (apply 'format build-report-subject args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (let ((report-begin (point)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 (insert (build-report-insert-make-output report-begin))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 (insert (build-report-insert-installation-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 report-begin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 build-report-installation-insert-all))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 (insert (build-report-insert-header report-begin))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 (goto-char report-begin))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 (defun build-report-insert-header (where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 "Inserts the build-report-header at the point specified by `where'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 (with-temp-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 (insert "\n> XEmacs Build Report as generated\n> by"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 " build-report-version "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 build-report-version " follows:\n\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 (buffer-string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 (defun build-report-insert-make-output (where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 "Inserts the output of the XEmacs Beta make run.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 The make process output must have been saved in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 `build-report-make-output-file' during the XEmacs Beta building."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 (with-temp-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 (if (file-exists-p build-report-make-output-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 (if (featurep 'mime-setup)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (mime-edit-insert-tag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 "text"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 "plain"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 (concat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 "\nContent-Disposition: attachment;"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 " filename=\""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 (file-name-nondirectory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 build-report-make-output-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 "\""))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 (mime-edit-insert-binary-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 build-report-make-output-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 build-report-file-encoding))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 (insert-file-contents build-report-make-output-file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 (delete-non-matching-lines (build-report-keep))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 (delete-matching-lines (build-report-delete))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 (insert "> Contents of "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 build-report-make-output-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 "\n> keeping lines matching\n> \""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 (build-report-keep)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 "\"\n> and then deleting lines matching\n> \""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 (build-report-delete)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 "\"\n\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 (insert "> " build-report-make-output-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 " does not exist!\n\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 (buffer-string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 (defun build-report-insert-installation-file (where all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 "Inserts the contents of the `build-report-installation-file'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 created by the XEmacs Beta configure process."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 (with-temp-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 (if (file-exists-p build-report-installation-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 (let (file-begin last-configure)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 (insert "> Contents of "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 build-report-installation-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 ":\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 (insert
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 (format
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 "> (Output from %s of ./configure)\n\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 (if all "all runs" "most recent run")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (if (featurep 'mime-setup)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 (mime-edit-insert-tag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 "text"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 "plain"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 (concat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 "\nContent-Disposition: attachment;"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 " filename=\""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 (file-name-nondirectory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 build-report-installation-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 "\""))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 (mime-edit-insert-binary-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 build-report-installation-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 build-report-file-encoding)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 (setq file-begin (mime-edit-content-beginning)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 (setq file-begin (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (insert-file-contents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 build-report-installation-file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 (unless all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (setq last-configure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 (search-backward-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 "^\\(uname.*\\|osversion\\):\\s-+" file-begin t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (if (and file-begin last-configure)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 (delete-region file-begin last-configure))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 (insert "> " build-report-installation-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 " does not exist!\n\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 (buffer-string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 (defun build-report-keep ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 "build-report-internal function of no general value."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 (mapconcat #'identity
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (defun build-report-delete ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 "build-report-internal function of no general value."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (mapconcat #'identity
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 build-report-delete-regexp "\\|"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 ;;; build-report.el ends here