annotate lisp/build-report.el @ 665:fdefd0186b75

[xemacs-hg @ 2001-09-20 06:28:42 by ben] The great integral types renaming. The purpose of this is to rationalize the names used for various integral types, so that they match their intended uses and follow consist conventions, and eliminate types that were not semantically different from each other. The conventions are: -- All integral types that measure quantities of anything are signed. Some people disagree vociferously with this, but their arguments are mostly theoretical, and are vastly outweighed by the practical headaches of mixing signed and unsigned values, and more importantly by the far increased likelihood of inadvertent bugs: Because of the broken "viral" nature of unsigned quantities in C (operations involving mixed signed/unsigned are done unsigned, when exactly the opposite is nearly always wanted), even a single error in declaring a quantity unsigned that should be signed, or even the even more subtle error of comparing signed and unsigned values and forgetting the necessary cast, can be catastrophic, as comparisons will yield wrong results. -Wsign-compare is turned on specifically to catch this, but this tends to result in a great number of warnings when mixing signed and unsigned, and the casts are annoying. More has been written on this elsewhere. -- All such quantity types just mentioned boil down to EMACS_INT, which is 32 bits on 32-bit machines and 64 bits on 64-bit machines. This is guaranteed to be the same size as Lisp objects of type `int', and (as far as I can tell) of size_t (unsigned!) and ssize_t. The only type below that is not an EMACS_INT is Hashcode, which is an unsigned value of the same size as EMACS_INT. -- Type names should be relatively short (no more than 10 characters or so), with the first letter capitalized and no underscores if they can at all be avoided. -- "count" == a zero-based measurement of some quantity. Includes sizes, offsets, and indexes. -- "bpos" == a one-based measurement of a position in a buffer. "Charbpos" and "Bytebpos" count text in the buffer, rather than bytes in memory; thus Bytebpos does not directly correspond to the memory representation. Use "Membpos" for this. -- "Char" refers to internal-format characters, not to the C type "char", which is really a byte. -- For the actual name changes, see the script below. I ran the following script to do the conversion. (NOTE: This script is idempotent. You can safely run it multiple times and it will not screw up previous results -- in fact, it will do nothing if nothing has changed. Thus, it can be run repeatedly as necessary to handle patches coming in from old workspaces, or old branches.) There are two tags, just before and just after the change: `pre-integral-type-rename' and `post-integral-type-rename'. When merging code from the main trunk into a branch, the best thing to do is first merge up to `pre-integral-type-rename', then apply the script and associated changes, then merge from `post-integral-type-change' to the present. (Alternatively, just do the merging in one operation; but you may then have a lot of conflicts needing to be resolved by hand.) Script `fixtypes.sh' follows: ----------------------------------- cut ------------------------------------ files="*.[ch] s/*.h m/*.h config.h.in ../configure.in Makefile.in.in ../lib-src/*.[ch] ../lwlib/*.[ch]" gr Memory_Count Bytecount $files gr Lstream_Data_Count Bytecount $files gr Element_Count Elemcount $files gr Hash_Code Hashcode $files gr extcount bytecount $files gr bufpos charbpos $files gr bytind bytebpos $files gr memind membpos $files gr bufbyte intbyte $files gr Extcount Bytecount $files gr Bufpos Charbpos $files gr Bytind Bytebpos $files gr Memind Membpos $files gr Bufbyte Intbyte $files gr EXTCOUNT BYTECOUNT $files gr BUFPOS CHARBPOS $files gr BYTIND BYTEBPOS $files gr MEMIND MEMBPOS $files gr BUFBYTE INTBYTE $files gr MEMORY_COUNT BYTECOUNT $files gr LSTREAM_DATA_COUNT BYTECOUNT $files gr ELEMENT_COUNT ELEMCOUNT $files gr HASH_CODE HASHCODE $files ----------------------------------- cut ------------------------------------ `fixtypes.sh' is a Bourne-shell script; it uses 'gr': ----------------------------------- cut ------------------------------------ #!/bin/sh # Usage is like this: # gr FROM TO FILES ... # globally replace FROM with TO in FILES. FROM and TO are regular expressions. # backup files are stored in the `backup' directory. from="$1" to="$2" shift 2 echo ${1+"$@"} | xargs global-replace "s/$from/$to/g" ----------------------------------- cut ------------------------------------ `gr' in turn uses a Perl script to do its real work, `global-replace', which follows: ----------------------------------- cut ------------------------------------ : #-*- Perl -*- ### global-modify --- modify the contents of a file by a Perl expression ## Copyright (C) 1999 Martin Buchholz. ## Copyright (C) 2001 Ben Wing. ## Authors: Martin Buchholz <martin@xemacs.org>, Ben Wing <ben@xemacs.org> ## Maintainer: Ben Wing <ben@xemacs.org> ## Current Version: 1.0, May 5, 2001 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with XEmacs; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. eval 'exec perl -w -S $0 ${1+"$@"}' if 0; use strict; use FileHandle; use Carp; use Getopt::Long; use File::Basename; (my $myName = $0) =~ s@.*/@@; my $usage=" Usage: $myName [--help] [--backup-dir=DIR] [--line-mode] [--hunk-mode] PERLEXPR FILE ... Globally modify a file, either line by line or in one big hunk. Typical usage is like this: [with GNU print, GNU xargs: guaranteed to handle spaces, quotes, etc. in file names] find . -name '*.[ch]' -print0 | xargs -0 $0 's/\bCONST\b/const/g'\n [with non-GNU print, xargs] find . -name '*.[ch]' -print | xargs $0 's/\bCONST\b/const/g'\n The file is read in, either line by line (with --line-mode specified) or in one big hunk (with --hunk-mode specified; it's the default), and the Perl expression is then evalled with \$_ set to the line or hunk of text, including the terminating newline if there is one. It should destructively modify the value there, storing the changed result in \$_. Files in which any modifications are made are backed up to the directory specified using --backup-dir, or to `backup' by default. To disable this, use --backup-dir= with no argument. Hunk mode is the default because it is MUCH MUCH faster than line-by-line. Use line-by-line only when it matters, e.g. you want to do a replacement only once per line (the default without the `g' argument). Conversely, when using hunk mode, *ALWAYS* use `g'; otherwise, you will only make one replacement in the entire file! "; my %options = (); $Getopt::Long::ignorecase = 0; &GetOptions ( \%options, 'help', 'backup-dir=s', 'line-mode', 'hunk-mode', ); die $usage if $options{"help"} or @ARGV <= 1; my $code = shift; die $usage if grep (-d || ! -w, @ARGV); sub SafeOpen { open ((my $fh = new FileHandle), $_[0]); confess "Can't open $_[0]: $!" if ! defined $fh; return $fh; } sub SafeClose { close $_[0] or confess "Can't close $_[0]: $!"; } sub FileContents { my $fh = SafeOpen ("< $_[0]"); my $olddollarslash = $/; local $/ = undef; my $contents = <$fh>; $/ = $olddollarslash; return $contents; } sub WriteStringToFile { my $fh = SafeOpen ("> $_[0]"); binmode $fh; print $fh $_[1] or confess "$_[0]: $!\n"; SafeClose $fh; } foreach my $file (@ARGV) { my $changed_p = 0; my $new_contents = ""; if ($options{"line-mode"}) { my $fh = SafeOpen $file; while (<$fh>) { my $save_line = $_; eval $code; $changed_p = 1 if $save_line ne $_; $new_contents .= $_; } } else { my $orig_contents = $_ = FileContents $file; eval $code; if ($_ ne $orig_contents) { $changed_p = 1; $new_contents = $_; } } if ($changed_p) { my $backdir = $options{"backup-dir"}; $backdir = "backup" if !defined ($backdir); if ($backdir) { my ($name, $path, $suffix) = fileparse ($file, ""); my $backfulldir = $path . $backdir; my $backfile = "$backfulldir/$name"; mkdir $backfulldir, 0755 unless -d $backfulldir; print "modifying $file (original saved in $backfile)\n"; rename $file, $backfile; } WriteStringToFile ($file, $new_contents); } } ----------------------------------- cut ------------------------------------ In addition to those programs, I needed to fix up a few other things, particularly relating to the duplicate definitions of types, now that some types merged with others. Specifically: 1. in lisp.h, removed duplicate declarations of Bytecount. The changed code should now look like this: (In each code snippet below, the first and last lines are the same as the original, as are all lines outside of those lines. That allows you to locate the section to be replaced, and replace the stuff in that section, verifying that there isn't anything new added that would need to be kept.) --------------------------------- snip ------------------------------------- /* Counts of bytes or chars */ typedef EMACS_INT Bytecount; typedef EMACS_INT Charcount; /* Counts of elements */ typedef EMACS_INT Elemcount; /* Hash codes */ typedef unsigned long Hashcode; /* ------------------------ dynamic arrays ------------------- */ --------------------------------- snip ------------------------------------- 2. in lstream.h, removed duplicate declaration of Bytecount. Rewrote the comment about this type. The changed code should now look like this: --------------------------------- snip ------------------------------------- #endif /* The have been some arguments over the what the type should be that specifies a count of bytes in a data block to be written out or read in, using Lstream_read(), Lstream_write(), and related functions. Originally it was long, which worked fine; Martin "corrected" these to size_t and ssize_t on the grounds that this is theoretically cleaner and is in keeping with the C standards. Unfortunately, this practice is horribly error-prone due to design flaws in the way that mixed signed/unsigned arithmetic happens. In fact, by doing this change, Martin introduced a subtle but fatal error that caused the operation of sending large mail messages to the SMTP server under Windows to fail. By putting all values back to be signed, avoiding any signed/unsigned mixing, the bug immediately went away. The type then in use was Lstream_Data_Count, so that it be reverted cleanly if a vote came to that. Now it is Bytecount. Some earlier comments about why the type must be signed: This MUST BE SIGNED, since it also is used in functions that return the number of bytes actually read to or written from in an operation, and these functions can return -1 to signal error. Note that the standard Unix read() and write() functions define the count going in as a size_t, which is UNSIGNED, and the count going out as an ssize_t, which is SIGNED. This is a horrible design flaw. Not only is it highly likely to lead to logic errors when a -1 gets interpreted as a large positive number, but operations are bound to fail in all sorts of horrible ways when a number in the upper-half of the size_t range is passed in -- this number is unrepresentable as an ssize_t, so code that checks to see how many bytes are actually written (which is mandatory if you are dealing with certain types of devices) will get completely screwed up. --ben */ typedef enum lstream_buffering --------------------------------- snip ------------------------------------- 3. in dumper.c, there are four places, all inside of switch() statements, where XD_BYTECOUNT appears twice as a case tag. In each case, the two case blocks contain identical code, and you should *REMOVE THE SECOND* and leave the first.
author ben
date Thu, 20 Sep 2001 06:31:11 +0000
parents 0a255b32b157
children 151d438d2d55
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
501
0a255b32b157 [xemacs-hg @ 2001-05-03 21:08:39 by adrian]
adrian
parents: 468
diff changeset
3 ;; Copyright (C) 1997-2001 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>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
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 ;; XEmacs is free software; you can redistribute it and/or modify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; 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
12 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; 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
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;;; Synched up with: Not synched.
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
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
60 "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+configured\\s-+for\\s-+`\\(.+\\)'\\."
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]+\\)?
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
69 xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\""
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
70 "*REGEXP matching XEmacs Beta Version variable assignments in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
71 `build-report-version-file' file. This variable is used by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
72 `build-report-version-file-data'.")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
73
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
74 (defconst build-report-installation-srcdir-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
75 "\\s-*Where should the build process find the source code\\?\\s-*\\(.*\\)$"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
76 "REGEXP matching XEmacs Beta srcdir as the first substring match in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
77 `build-report-installation-file' file. This variable is used by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
78 `build-report-installation-data'.")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
79
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
80 ;;; Customization support for build-report starts here.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 (defgroup build-report nil
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
83 "Standardizes the Creation of XEmacs Build Reports."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
84 :load 'build-report
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 :group 'build)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 (defcustom build-report-destination
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
88 (list
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
89 "XEmacs Build Reports List <xemacs-buildreports@xemacs.org>"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
90 "XEmacs Beta List <xemacs-beta@xemacs.org>")
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
91 "*The list of mail addresses XEmacs Build Reports should most likely
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
92 go to."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
93 :type '(repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
94 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
95 :documentation-shown t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
96 string)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (defcustom build-report-keep-regexp
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
100 (list
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
101 "^\\(cd\\|n?make\\)\\s-"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
102 "errors?"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
103 "warnings?"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
104 "pure.*\\(space\\|size\\)"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
105 "hides\\b"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
106 "strange"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
107 "shadowings"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
108 "^Compil\\(ing\\s-+in\\|ation\\)"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
109 "^Using"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
110 "not\\s-+found"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
111 "^While\\s-+compiling.*\\(\n\\s-+.+\\)*"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
112 "^Note:"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
113 "Installing"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
114 "[Ff]ile(s) copied"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
115 "\\s-+tests\\s-+")
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
116 "*Regexp of make process output lines to keep in the report."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
117 :type '(repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
118 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
119 :documentation-shown t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
120 regexp)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (defcustom build-report-delete-regexp
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
124 (list
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
125 "confl.*with.*auto-inlining"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
126 "^Formatting:"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
127 "(100%) tests successful")
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
128 "*Regexp of make process output lines to delete from the report."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
129 :type '(repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
130 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
131 :documentation-shown t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
132 regexp)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
135 (defcustom build-report-make-output-dir
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
136 (cond
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
137 ((equal system-type 'windows-nt)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
138 (expand-file-name "nt"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
139 (gethash 'blddir (config-value-hash-table))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
140 (t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
141 (gethash 'blddir (config-value-hash-table))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
142 "*Directory where the build report file is found.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
143 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
144 the XEmacs build directory."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
145 :type '(directory
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
146 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
147 :documentation-shown t)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
148 :group 'build-report)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
149
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
150 (defcustom build-report-make-output-files
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
151 (list
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
152 "beta.err"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
153 "xemacs-make-all.err"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
154 "xemacs-make-check-temacs.err"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
155 "xemacs-make-check.err"
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 442
diff changeset
156 "xemacs-make-install.err")
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
157 "*List of Filenames where stdout and stderr of XEmacs make process
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
158 have been stored. These are relative to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
159 `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
160 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
161 may use following alias
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
162
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 alias mk 'make \!* >>&\! \!$.err &'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
164
501
0a255b32b157 [xemacs-hg @ 2001-05-03 21:08:39 by adrian]
adrian
parents: 468
diff changeset
165 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
166 :type '(repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
167 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
168 :documentation-shown t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
169 file)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 (defcustom build-report-installation-file
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
173 (expand-file-name "Installation"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
174 (gethash 'blddir (config-value-hash-table)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
175 "*Installation file produced by XEmacs configure process."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
176 :type '(file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
177 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
178 :documentation-shown t)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
181 (defcustom build-report-version-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
182 (expand-file-name
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
183 "version.sh"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
184 (gethash 'blddir (config-value-hash-table)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
185 "*version.sh file identifying XEmacs (Beta) Distribution."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
186 :type '(file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
187 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
188 :documentation-shown t)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
189 :group 'build-report)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
190
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
191 (defcustom build-report-installation-insert-all
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
192 nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
193 "*Tell build-report to insert the whole Installation file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
194 instead of just the last report."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 :type 'boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 (defcustom build-report-subject
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 (concat "[%s] " emacs-version " on " system-configuration)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
200 "*XEmacs Build Report Subject Line. %s-sequences will be substituted
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
201 with user input through `build-report' according to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
202 `build-report-prompts' using `format'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
203 :type '(string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
204 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
205 :documentation-shown t)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (defcustom build-report-prompts
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
209 (quote (("Status?: " ("Success" "Failure"))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
210 "*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
211 lists used by `build-report' in conjunction with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
212 `build-report-subject'. Each list consists of a prompt string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
213 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
214 mechanism."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
215 :type '(repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
216 :custom-show t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
217 :documentation-shown t
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
218 (list
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
219 :tag "Prompt"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
220 string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
221 (repeat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
222 :tag "Values"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
223 string)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 (defcustom build-report-file-encoding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 "7bit"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
228 "*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
229 available."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 :group 'build-report)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 ;; Symbol Name mappings from TM to SEMI serving as Compatibility
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 ;; Bandaid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 (when (featurep 'mime-setup)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 ;; No (defvaralias ...) so far. Thanks to "Didier Verna"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
236 ;; <didier@xemacs.org> for reporting my incorrect defvaraliasing of
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 ;; `mime-editor/insert-tag'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 ;; Thanks to Jens-Ulrik Holger Petersen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 ;; <petersen@kurims.kyoto-u.ac.jp> for suggesting the conditional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 ;; aliasing of SEMI functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 (unless (fboundp 'mime-edit-content-beginning)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 (defalias 'mime-edit-content-beginning 'mime-editor/content-beginning))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 (unless (fboundp 'mime-edit-insert-tag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 (defalias 'mime-edit-insert-tag 'mime-editor/insert-tag))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 (unless (fboundp 'mime-edit-insert-binary-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (defalias 'mime-edit-insert-binary-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 'mime-editor/insert-binary-file)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
249 (defun build-report-make-output-get ()
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
250 "Returns the filename the XEmacs make output is saved in."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
251 (interactive)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
252 (if (or (string-equal build-report-make-output-dir "")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
253 (null build-report-make-output-dir))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
254 (mapcar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
255 (function
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
256 (lambda (f)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
257 (expand-file-name
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
258 f
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
259 (file-name-as-directory
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
260 (gethash 'blddir (config-value-hash-table))))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
261 build-report-make-output-files)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
262 (mapcar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
263 (function
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
264 (lambda (f)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
265 (expand-file-name
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
266 f
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
267 (file-name-as-directory build-report-make-output-dir))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
268 build-report-make-output-files)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
269
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
270 ;;;###autoload
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 (defun build-report (&rest args)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
272 "Report build information including Installation and make output.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
273
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
274 Prompts for status (usually \"Success\" or \"Failure\"). Then uses
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
275 `compose-mail' to create a mail message. The Subject header contains
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
276 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
277 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
278
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
279 Looks for Installation and the make output file (`beta.err' by
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
280 default, customizable via `build-report-make-output-files') in the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
281 build directory of the running XEmacs by default (customizable via
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
282 `build-report-make-output-dir'). The output from make is filtered
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
283 through `build-report-keep-regexp' and `build-report-delete-regexp'
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
284 before including in the message.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
285
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
286 See also `mail-user-agent', `build-report-destination', and
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 460
diff changeset
287 `build-report-installation-file'."
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
288 ;; `interactive' form returns value for formal parameter `args'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 (interactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (let (prompt
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
291 hist
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
292 arg
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
293 (prompts build-report-prompts))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 (while prompts
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
296 (defvar hist)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
297 (setq prompt (caar prompts))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
298 (setq hist (cdar prompts))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
299 ;; `build-report-prompts' used to be a list of lists, the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
300 ;; first element of each list being the prompt, the rest being
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
301 ;; the history. The history is now in a separate list. We
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
302 ;; better check for that.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
303 (if (listp (car hist))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
304 (setq hist (car hist)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
305 (setq prompts (cdr prompts))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
306 (setq arg (cons (read-string prompt "" 'hist) arg)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 arg)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 (save-excursion
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
309 (if (file-exists-p build-report-installation-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
310 (multiple-value-bind
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
311 (major minor beta codename configuration)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
312 (build-report-installation-data build-report-installation-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
313 (setq build-report-subject
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
314 (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
315 major minor beta codename configuration)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
316 (multiple-value-bind
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
317 (major minor beta codename)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
318 (build-report-version-file-data build-report-version-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
319 (setq build-report-subject
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
320 (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
321 major minor beta codename system-configuration))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 (compose-mail
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
323 ;; `build-report-destination' used to be a single string, so
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
324 ;; let's test if we really get a list of destinations.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
325 (if (listp build-report-destination)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
326 (read-string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
327 "Build Report Destination: "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
328 (car build-report-destination)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
329 'build-report-destination)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
330 (read-string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
331 "Build Report Destination: "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
332 build-report-destination)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
333 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 (apply 'format build-report-subject args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 nil)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
340 (let* ((report-begin (point))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
341 (files (reverse (build-report-make-output-get)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
342 (file (car files)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
343 (while file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
344 (if (file-exists-p file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
345 (insert (build-report-insert-make-output report-begin file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
346 (insert (format "%s not found!\n" file)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
347 (insert "\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
348 (setq files (cdr files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
349 (setq file (car files)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
350 (if (file-exists-p build-report-installation-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
351 (insert (build-report-insert-installation-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
352 report-begin
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
353 build-report-installation-insert-all))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
354 (insert (format "%s not found!\n" build-report-installation-file)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
355 ;;; (when (and (>= major 21) (>= minor 2) (or (null beta) (>= beta 32)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
356 ;;; (insert "\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
357 ;;; (insert (build-report-insert-config-inc report-begin)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
358 (insert "\n")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 (insert (build-report-insert-header report-begin))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 (goto-char report-begin))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (defun build-report-insert-header (where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 "Inserts the build-report-header at the point specified by `where'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 (with-temp-buffer
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
366 (insert
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
367 (format "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
368 > XEmacs Build Report generated by emacs-version
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
369 > %s
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
370 > with system-configuration
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
371 > %s
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
372 > follows:\n\n" emacs-version system-configuration))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (buffer-string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
375 (defun build-report-insert-make-output (where file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
376 "Inserts the output of the XEmacs Beta make run in the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
377 current buffer at position WHERE.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 The make process output must have been saved in
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
379 `build-report-make-output-files' during the XEmacs Beta building."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 (with-temp-buffer
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
382 (if (file-exists-p file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
383 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
384 (if (featurep 'mime-setup)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
385 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
386 (mime-edit-insert-tag
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
387 "text"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
388 "plain"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
389 (concat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
390 "\nContent-Disposition: attachment;"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
391 " filename=\""
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
392 (file-name-nondirectory
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
393 file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
394 "\""))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
395 (mime-edit-insert-binary-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
396 file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
397 build-report-file-encoding))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
398 (insert-file-contents file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
399 (when build-report-keep-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
400 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
401 (delete-non-matching-lines (build-report-keep)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
402 (when build-report-delete-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
403 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
404 (delete-matching-lines (build-report-delete)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
405 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
406 (if build-report-keep-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
407 (insert
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
408 (format
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
409 "> keeping lines matching
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
410 > \"%s\"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
411 "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
412 (build-report-keep))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
413 (if build-report-delete-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
414 (insert
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
415 (format
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
416 "> %sdeleting lines matching
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
417 > \"%s\"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
418 "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
419 (if build-report-keep-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
420 "and then "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
421 "")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
422 (build-report-delete))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
423 (insert "\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
424 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
425 (insert
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
426 (format "> Contents of %s\n" file)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
427 (insert "> " file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
428 " does not exist!\n\n"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 (buffer-string)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
430
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 (defun build-report-insert-installation-file (where all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 "Inserts the contents of the `build-report-installation-file'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 created by the XEmacs Beta configure process."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 (goto-char where)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 (with-temp-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 (if (file-exists-p build-report-installation-file)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
437 (let (file-begin last-configure)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
438 (insert "> Contents of "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
439 build-report-installation-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
440 ":\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
441 (insert
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
442 (format
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
443 "> (Output from %s of ./configure)\n\n"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
444 (if all "all runs" "most recent run")))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
445 (if (featurep 'mime-setup)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
446 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
447 (mime-edit-insert-tag
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
448 "text"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
449 "plain"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
450 (concat
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
451 "\nContent-Disposition: attachment;"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
452 " filename=\""
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
453 (file-name-nondirectory
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
454 build-report-installation-file)
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 (mime-edit-insert-binary-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
457 build-report-installation-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
458 build-report-file-encoding)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
459 (setq file-begin (mime-edit-content-beginning)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
460 (setq file-begin (point))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
461 (insert-file-contents
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
462 build-report-installation-file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
463 (unless all
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
464 (setq last-configure
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
465 (search-backward-regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
466 "^\\(uname.*\\|osversion\\|OS\\):\\s-+" file-begin t))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
467 (if (and file-begin last-configure)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
468 (delete-region file-begin last-configure))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 (insert "> " build-report-installation-file
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
470 " does not exist!\n\n"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 (buffer-string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 (defun build-report-keep ()
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
474 "Concatenate elements of `build-report-keep-regexp' and a general
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
475 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
476 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
477 (mapconcat #'identity
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
478 (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 (defun build-report-delete ()
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
481 "Concatenate elements of `build-report-delete-regexp' and a general
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
482 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
483 REGEXPs in `build-report-delete-regexp' or a general MIME tag REGEXP."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
484 (mapconcat '(lambda (item) item)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
485 build-report-delete-regexp "\\|"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
486
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
487 (defun build-report-installation-data (&optional file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
488 "Return a list of XEmacs installation data containing MAJOR_NUMBER
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
489 MINOR_NUMBER BETA_STRING CODENAME CONFIGURATION SRCDIR from FILE,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
490 which defaults to `build-report-installation-file'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
491 (interactive "fInstallation file: ")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
492 (unless file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
493 (setq file build-report-installation-file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
494 (let
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
495 (major minor beta codename configuration srcdir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
496 (save-window-excursion
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
497 (find-file-read-only file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
498 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
499 (while (< (point) (point-max))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
500 (cond
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
501 ((looking-at build-report-installation-version-regexp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
502 (goto-char (match-end 0))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
503 (setq major (match-string 1))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
504 (setq minor (match-string 2))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
505 (setq beta (match-string 3))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
506 (setq codename (match-string 6))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
507 (setq configuration (match-string 7)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
508 ((looking-at build-report-installation-srcdir-regexp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
509 (goto-char (match-end 0))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
510 (setq srcdir (match-string 1)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
511 ;; We avoid matching a potentially zero-length string to avoid
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
512 ;; infinite looping.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
513 ((looking-at
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
514 "^.+$")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
515 (goto-char (match-end 0)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
516 ((looking-at "\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
517 (goto-char (match-end 0)))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
518 (values major minor (or beta "") codename configuration srcdir))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
519
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
520 (defun build-report-version-file-data (&optional file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
521 "Return a list of XEmacs version information containing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
522 MAJOR_NUMBER MINOR_NUMBER BETA_STRING CODENAME from FILE, which
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
523 defaults to `build-report-version-file'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
524 (interactive "fversion.sh file: ")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
525 (unless file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
526 (setq file build-report-version-file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
527 (let
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
528 (major minor beta codename)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
529 (save-window-excursion
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
530 (find-file-read-only file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
531 (goto-char (point-min))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
532 (while (< (point) (point-max))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
533 (cond
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
534 ((looking-at build-report-version-file-regexp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
535 (goto-char (match-end 0))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
536 (setq major (match-string 1))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
537 (setq minor (match-string 2))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
538 (setq beta (match-string 3))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
539 (setq codename (match-string 4)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
540 ;; We avoid matching a potentially zero-length string to avoid
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
541 ;; infinite looping.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
542 ((looking-at
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
543 "^.+$")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
544 (goto-char (match-end 0)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
545 ((looking-at "\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
546 (goto-char (match-end 0)))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
547 (values major minor (or beta "") codename))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 ;;; build-report.el ends here