annotate lisp/build-report.el @ 5914:bd4d2c8ef9cc

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