Commits

Anonymous committed e2a3b0a

packages: Improvements for build package

-------------------- ChangeLog entries follow: --------------------

xemacs-packages/build/ChangeLog addition:

2002-11-26 Adrian Aichner <adrian@xemacs.org>

* build-report.el: Sync with XEmacs core improvements.
* build-report.el (build-report-installation-version-regexp):
Support xemacs_extra_name.
* build-report.el (build-report-version-file-regexp): Ditto.
* build-report.el (build-report-keep-regexp): Add useful stuff.
* build-report.el (build-report-delete-regexp): Don't delete
successful tests.
* build-report.el (build-report-make-output-files): Typo fix.
* build-report.el (build-report): Sync docstring from core.
* build-report.el (build-report-installation-data): Support
xemacs_extra_name. Default missing version information components
by defaulting to "".
* build-report.el (build-report-version-file-data): Ditto.
* build.el:
* build.el (build-call-process): Moved.
* build.el (build-compilation-mode-hook): Include time zone
information.
* build.el (build-cvs-get-branch-and-release-tags): New. Retrieve
release tags from version.sh via CVS.
* build.el (build-cvs-xemacs-release): Remove static definition
in favor of `build-cvs-get-branch-and-release-tags'.
* build.el (build-cvs-login): Fix bug in build-cvs-available-p
house-keeping.
* build.el (build-tarball-site): Generate list dynamically from
`package-get-download-sites'. Unification!
* build.el (build-with-MS-make-options): Fix default value.
* build.el (build-with-GNU): Set `build-report-installation-file'
and `build-report-version-file'.
* build.el (build-with-MS): Set `build-report-installation-file'
in addtion to `build-report-version-file'. Tell user not to
forget saving config.inc.

Comments (0)

Files changed (3)

+2002-11-26  Adrian Aichner  <adrian@xemacs.org>
+
+	* build-report.el: Sync with XEmacs core improvements.
+	* build-report.el (build-report-installation-version-regexp):
+	Support xemacs_extra_name.
+	* build-report.el (build-report-version-file-regexp): Ditto.
+	* build-report.el (build-report-keep-regexp): Add useful stuff.
+	* build-report.el (build-report-delete-regexp): Don't delete
+	successful tests.
+	* build-report.el (build-report-make-output-files): Typo fix.
+	* build-report.el (build-report): Sync docstring from core.
+	* build-report.el (build-report-installation-data): Support
+	xemacs_extra_name.  Default missing version information components
+	by defaulting to "".
+	* build-report.el (build-report-version-file-data): Ditto.
+	* build.el:
+	* build.el (build-call-process): Moved.
+	* build.el (build-compilation-mode-hook): Include time zone
+	information.
+	* build.el (build-cvs-get-branch-and-release-tags): New.  Retrieve
+	release tags from version.sh via CVS.
+	* build.el (build-cvs-xemacs-release): Remove static definition
+	in favor of `build-cvs-get-branch-and-release-tags'.
+	* build.el (build-cvs-login): Fix bug in build-cvs-available-p
+	house-keeping.
+	* build.el (build-tarball-site): Generate list dynamically from
+	`package-get-download-sites'.  Unification!
+	* build.el (build-with-MS-make-options): Fix default value.
+	* build.el (build-with-GNU): Set `build-report-installation-file'
+	and `build-report-version-file'.
+	* build.el (build-with-MS): Set `build-report-installation-file'
+	in addtion to `build-report-version-file'.  Tell user not to
+	forget saving config.inc.
+
 2002-10-15  Ville Skytt�  <scop@xemacs.org>
 
 	* Makefile (srckit): Remove.
 
 ;; Author: Adrian Aichner <adrian@xemacs.org>
 ;; Date: $Date$
-;; Version: $Name$
+;; Version: $Revision$
 ;; Keywords: internal
 
 ;; This file is part of XEmacs.
 ;;; report it to the maintainers of `build-report' when you think you
 ;;; need to do this.
 (defconst build-report-installation-version-regexp
-  "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+configured\\s-+for\\s-+`\\(.+\\)'\\."
+  "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+\\(.*\\)?configured\\s-+for\\s-+`\\(.+\\)'\\."
   "*REGEXP matching XEmacs Beta Version string in
 `build-report-installation-file' file.  This variable is used by
 `build-report-installation-data'.")
   "emacs_major_version\\s-*=\\s-*\\([0-9]+\\)
 emacs_minor_version\\s-*=\\s-*\\([0-9]+\\)
 emacs_beta_version\\s-*=\\s-*\\([0-9]+\\)?
-xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\""
+xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\"\\(
+xemacs_extra_name\\s-*=\\s-*\"\\([^\"]+\\)\"\\)?"
   "*REGEXP matching XEmacs Beta Version variable assignments in
 `build-report-version-file' file.  This variable is used by
 `build-report-version-file-data'.")
    "^Note:"
    "Installing"
    "[Ff]ile(s) copied"
-   "\\s-+tests\\s-+")
+   "\\s-+tests\\s-+"
+   "^[A-Z] [^ ]+$"
+   "^Wrong number of arguments:"
+   "^  \\*\\* ")
   "*Regexp of make process output lines to keep in the report."
   :type '(repeat
           :custom-show t
 (defcustom build-report-delete-regexp
   (list
    "confl.*with.*auto-inlining"
-   "^Formatting:"
-   "(100%) tests successful")
+   "^Formatting:")
   "*Regexp of make process output lines to delete from the report."
   :type '(repeat
           :custom-show t
 
 alias mk 'make \!* >>&\! \!$.err &'
 
-under csh, so that you get beta.err went you run `mk beta'."
+under csh, so that you get beta.err when you run `mk beta'."
   :type '(repeat
           :custom-show t
           :documentation-shown t
 
 ;;;###autoload
 (defun build-report (&rest args)
-  "Composes a fresh mail message with the contents of the built XEmacs
-Installation file and excerpts from XEmacs make output.
-`compose-mail' is used to create the mail message.  Point is left at
-the beginning of the mail text.  You may add some personal notes if
-you like and send the report.
-See also
-  `compose-mail', `mail-user-agent',
-  `build-report-destination',
-  `build-report-keep-regexp',
-  `build-report-delete-regexp',
-  `build-report-make-output-dir',
-  `build-report-make-output-files', and
-  `build-report-installation-file'."
+  "Report build information including Installation and make output.
+
+Prompts for status (usually \"Success\" or \"Failure\").  Then uses
+`compose-mail' to create a mail message.  The Subject header contains
+status and version information.  Point is left at the beginning of the
+mail text.  Add some notes if you like, and send the report.
+
+Looks for Installation and the make output file (`beta.err' by
+default, customizable via `build-report-make-output-files') in the
+build directory of the running XEmacs by default (customizable via
+`build-report-make-output-dir').  The output from make is filtered
+through `build-report-keep-regexp' and `build-report-delete-regexp'
+before including in the message.
+
+See also `mail-user-agent', `build-report-destination', and
+`build-report-installation-file'."
   ;; `interactive' form returns value for formal parameter `args'.
   (interactive
    (let (prompt
   (save-excursion
     (if (file-exists-p build-report-installation-file)
         (multiple-value-bind
-            (major minor beta codename configuration)
+            (major minor beta codename extraname configuration)
             (build-report-installation-data build-report-installation-file)
           (setq build-report-subject
-                (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
-                        major minor beta codename configuration)))
+                (format "[%%s] XEmacs %s.%s%s \"%s\" %s%s"
+                        major minor beta codename extraname configuration)))
       (multiple-value-bind
-          (major minor beta codename)
+          (major minor beta codename extraname)
           (build-report-version-file-data build-report-version-file)
         (setq build-report-subject
-              (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
-                      major minor beta codename system-configuration))))
+              (format "[%%s] XEmacs %s.%s%s \"%s\" %s%s"
+                      major minor beta codename extraname system-configuration))))
     (compose-mail
      ;; `build-report-destination' used to be a single string, so
      ;; let's test if we really get a list of destinations.
   (unless file
     (setq file build-report-installation-file))
   (let
-      (major minor beta codename configuration srcdir)
+      (major minor beta codename extraname configuration srcdir)
     (save-window-excursion
       (find-file-read-only file)
       (goto-char (point-min))
         (cond
          ((looking-at build-report-installation-version-regexp)
           (goto-char (match-end 0))
-          (setq major (match-string 1))
-          (setq minor (match-string 2))
-          (setq beta (match-string 3))
-          (setq codename (match-string 6))
-          (setq configuration (match-string 7)))
+          (setq major (or (match-string 1) ""))
+          (setq minor (or (match-string 2) ""))
+          (setq beta (or (match-string 3) ""))
+          (setq codename (or (match-string 6) ""))
+	  (setq extraname (or (match-string 7) ""))
+          (setq configuration (or (match-string 8) "")))
          ((looking-at build-report-installation-srcdir-regexp)
           (goto-char (match-end 0))
-          (setq srcdir (match-string 1)))
+          (setq srcdir (or (match-string 1) "")))
          ;; We avoid matching a potentially zero-length string to avoid
          ;; infinite looping.
          ((looking-at
           (goto-char (match-end 0)))
          ((looking-at "\n")
           (goto-char (match-end 0)))))
-      (values major minor (or beta "") codename configuration srcdir))))
+      (values major minor beta codename extraname configuration srcdir))))
 
 (defun build-report-version-file-data (&optional file)
   "Return a list of XEmacs version information containing
   (unless file
     (setq file build-report-version-file))
   (let
-      (major minor beta codename)
+      (major minor beta codename extraname)
     (save-window-excursion
       (find-file-read-only file)
       (goto-char (point-min))
         (cond
          ((looking-at build-report-version-file-regexp)
           (goto-char (match-end 0))
-          (setq major (match-string 1))
-          (setq minor (match-string 2))
-          (setq beta (match-string 3))
-          (setq codename (match-string 4)))
+          (setq major (or (match-string 1) ""))
+          (setq minor (or (match-string 2) ""))
+          (setq beta (or (match-string 3) ""))
+          (setq codename (or (match-string 4) ""))
+	  (setq extraname (or (match-string 6) "")))
          ;; We avoid matching a potentially zero-length string to avoid
          ;; infinite looping.
          ((looking-at
           (goto-char (match-end 0)))
          ((looking-at "\n")
           (goto-char (match-end 0)))))
-      (values major minor (or beta "") codename))))
+      (values major minor beta codename extraname))))
 
 ;;; build-report.el ends here
 
 ;;}}}
 
+(defun build-call-process (command infile buffer displayp)
+  (let (exit-status result)
+    (with-temp-buffer
+      (condition-case signal
+          (setq exit-status
+                (apply 'call-process
+                       (append
+                        (list (car command) infile buffer displayp)
+                        (cdr command))))
+        (error
+         (warn "\n%s\ncannot be executed: %S %S\n"
+               (mapconcat 'identity command " ")
+               (car signal) (cdr signal))))
+      ;; return value of result
+      (setq result (cons exit-status (buffer-string))))))
+
 ;;{{{ Version info
 
 ;;;
        '(lambda ()
           (message "Auto-saved %s\n" (buffer-name))))
   (auto-save-mode 1)
-  (insert "Compilation started at " (current-time-string) "\n"))
+  (insert
+   (format
+    "Compilation started at %s %+.4d (%s)\n"
+    (current-time-string)
+    (/ (nth 0 (current-time-zone)) 36)
+    (nth 1 (current-time-zone)))))
 
 (defun build-compilation-finish-function (comp-buffer finish-string)
   (message "Build Make finished in %s with status \"%s\"."
   "Standardizes the fetching of XEmacs from the CVS repository."
   :group 'build)
 
+(defun build-cvs-get-branch-and-release-tags ()
+  "Retrieve all symbolic names (CVS tags) for XEmacs from version.sh."
+  (interactive)
+  (let*
+      (exit-status
+       (file "XEmacs/xemacs/version.sh")
+       (co-command
+        (list
+         "cvs" "-d" build-cvs-xemacs-repository "checkout" file))
+       (status-command
+        (list
+         "cvs" "-d" build-cvs-xemacs-repository "status" "-v" file))
+       infile
+       (buffer (list t t))
+       displayp
+       result
+       last-match-end
+       this-match-beginning
+       tags)
+    (cd (temp-directory))
+    (unless
+        (file-exists-p file)
+    (message-or-box
+     "build: checking out %s to determine cvs tags" file)
+      (setq result
+            (build-call-process co-command infile buffer displayp))
+      (cond
+       ((null (car result))
+        (warn "\nprogram %s cannot be found or executed\n"
+              (car co-command)))
+       ((/= (car result) 0)
+        (warn "\n%s\nfailed with following output:\n%s\n"
+              (mapconcat 'identity co-command " ")
+              (cdr result)))
+       (t
+        (message-or-box
+         "build: %s has been checked out" file))))
+    (message-or-box
+     "build: retrieving cvs tags from %s" file)
+    (setq result
+          (build-call-process status-command infile buffer displayp))
+    (cond
+     ((null (car result))
+      (warn "\nprogram %s cannot be found or executed\n"
+            (car status-command)))
+     ((/= (car result) 0)
+      (warn "\n%s\nfailed with following output:\n%s\n"
+            (mapconcat 'identity status-command " ")
+            (cdr result)))
+     (t
+      (message-or-box
+       "build: cvs tags have been retrieved from %s" file)))
+    (if
+        (setq this-match-beginning
+              (string-match "^\\s-+Existing Tags:\n" (cdr result)))
+        (setq last-match-end (match-end 0)))
+    (while
+        (and 
+         (setq this-match-beginning 
+               (string-match
+                "\t\\(\\S-+\\)\\s-+\\(.*\\)\n" (cdr result) last-match-end))
+         (= last-match-end this-match-beginning))
+      (setq last-match-end (match-end 0))
+      (if last-match-end
+          (push (list
+                 (match-string 1 (cdr result))
+                 (match-string 2 (cdr result))) tags)))
+    (reverse tags)))
+
 (defun build-cvs-checkout-options-validate (sym val)
   (cond
    ((string-match "-\\(d\\|N\\)\\b" val)
   :set 'build-cvs-set-var-and-update-buffer
   :group 'build-cvs)
 
-(defcustom build-cvs-xemacs-release
-  "HEAD"
-  "CVS XEmacs release to be checked out.  Use \"Specify Tag Name\" to fill in
-the name of a release tag not yet in the list of choices."
-  :type '(choice
-          :custom-state t
-          (const "ben-mule-21-5")
-          (const "ben-mule-21-5-bp")
-          (const "ben-mule-21-5-chkp-post-ikeyama-merge-success")
-          (const "ben-mule-21-5-last-sync")
-          (const "ben-mule-21-5-next-sync")
-          (const "ben-mule-21-5-post-oct-26-2001-sync")
-          (const "candidate-21-4")
-          (const "gtk-xemacs")
-          (const "gtk-xemacs-21-2")
-          (const "mule-21-5")
-          (const "r21-1-12")
-          (const "r21-1-14")
-          (const "r21-4-0")
-          (const "r21-4-1")
-          (const "r21-4-3")
-          (const "r21-4-5")
-          (const "r21-4-5-windows")
-          (const "r21-4-6")
-          (const "r21-4-6-windows")
-          (const "r21-4-6rc1")
-          (const "r21-5-0")
-          (const "r21-5-1")
-          (const "r21-5-2")
-          (const "r21-5-3")
-          (const "r21-5-4")
-          (const "r21-5-5")
-          (const "r21-5-latest-beta")
-          (const "release-21-1")
-          (const "release-21-2")
-          (const "release-21-4")
-          (const "release-21-4-bp")
-          (const "release-21-5")
-          (const "windows-21-4")
-          (string :tag "Unlisted Release Name" ""))
-  :set 'build-cvs-set-var-and-update-buffer
-  :group 'build-cvs)
-
 (defcustom build-cvs-xemacs-repository
   ":pserver:cvs@cvs.xemacs.org:/pack/xemacscvs"
   "CVS Repository where XEmacs can be checked out from."
   :set 'build-cvs-set-var-and-update-buffer
   :group 'build-cvs)
 
+(defcustom build-cvs-xemacs-release
+  "HEAD"
+  "CVS XEmacs release to be checked out.  Use \"Specify Tag Name\" to fill in
+the name of a release tag not yet in the list of choices."
+  :type (append
+         '(choice
+           :custom-state t)
+         (cons
+          '(string :tag "Unlisted Release Name" "")
+          (mapcar
+           (function
+            (lambda (tag)
+              (list
+               'const
+               :tag (format "%s %s" (first tag) (second tag)) (first tag))))
+           (build-cvs-get-branch-and-release-tags))))
+  :set 'build-cvs-set-var-and-update-buffer
+  :group 'build-cvs)
+
 (defun build-cvs-login ()
   "Login to XEmacs CVS repository."
   (interactive)
             (mapconcat 'identity command " ")
             (cdr result)))
      (t
-      (setq build-cvs-available-p nil)
+      (setq build-cvs-available-p t)
       (message-or-box "build: cvs login succeeded")))
     (delete-file file)))
 
 (defcustom build-tarball-site
   "/ftp@ftp.xemacs.org:/pub/xemacs/"
   "The EFS path to a top-level XEmacs directory to fetch the XEmacs
-  `build-tarball-set' from.  This list was last updated from
-   http://www.xemacs.org/Download/ on 2002-03-07."
+  `build-tarball-set' from.
+The list of available sites is dynamically generated based on
+`package-get-download-sites'.  In addition you may set the value to a
+manually chosen EFS path."
   :link '(url-link :tag "XEmacs Download Locations"
                    "http://www.xemacs.org/Download/")
-  :type '(choice
-          :custom-state t
-          (const "/ftp@ftp.at.xemacs.org:/editors/xemacs/")
-          (const "/ftp@ftp.au.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.be.xemacs.org:/xemacs/")
-          (const "/ftp@ftp.br.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.ca.xemacs.org:/pub/Mirror/xemacs/")
-          (const "/ftp@ftp.ch.xemacs.org:/mirror/xemacs/")
-          (const "/ftp@ftp.crc.ca:/pub/packages/editors/xemacs/")
-          (const "/ftp@ftp.cz.xemacs.org:/MIRRORS/ftp.xemacs.org/pub/xemacs/")
-          (const "/ftp@ftp.de.xemacs.org:/pub/ftp.xemacs.org/tux/xemacs/")
-          (const "/ftp@ftp.dk.xemacs.org:/pub/emacs/xemacs/")
-          (const "/ftp@ftp.fi.xemacs.org:/pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/")
-          (const "/ftp@ftp.fr.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.hu.xemacs.org:/pub/packages/xemacs/")
-          (const "/ftp@ftp.ie.xemacs.org:/mirrors/ftp.xemacs.org/pub/xemacs/")
-          (const "/ftp@ftp.it.xemacs.org:/unix/packages/XEMACS/")
-          (const "/ftp@ftp.jp.xemacs.org:/pub/GNU/xemacs/")
-          (const "/ftp@ftp.kr.xemacs.org:/pub/tools/emacs/xemacs/")
-          (const "/ftp@ftp.no.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.nz.xemacs.org:/mirror/ftp.xemacs.org/")
-          (const "/ftp@ftp.pasteur.fr:/pub/computing/xemacs/")
-          (const "/ftp@ftp.pl.xemacs.org:/pub/unix/editors/xemacs/")
-          (const "/ftp@ftp.ru.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.sa.xemacs.org:/pub/mirrors/ftp.xemacs.org/pub/xemacs/")
-          (const "/ftp@ftp.se.xemacs.org:/pub/gnu/xemacs/")
-          (const "/ftp@ftp.sk.xemacs.org:/pub/mirrors/xemacs/")
-          (const "/ftp@ftp.stealth.net:/pub/mirrors/ftp.xemacs.org/pub/xemacs/")
-          (const "/ftp@ftp.tu-darmstadt.de:/pub/editors/xemacs/")
-          (const "/ftp@ftp.tw.xemacs.org:/Editors/xemacs/")
-          (const "/ftp@ftp.uk.xemacs.org:/sites/ftp.xemacs.org/pub/xemacs/")
-          (const "/ftp@ftp.us.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.xemacs.org:/pub/xemacs/")
-          (const "/ftp@ftp.za.xemacs.org:/xemacs/")
-          (const "/ftp@ibiblio.org:/pub/packages/editors/xemacs/")
-          (const "/ftp@mirror.aarnet.edu.au:/pub/xemacs/")
-          (const "/ftp@sunsite.doc.ic.ac.uk:/packages/xemacs/")
-          (directory :tag "EFS Path" "/user@host.domain:/directory/"))
+  :type (append
+         '(choice :custom-state t)
+         (cons
+          '(directory :tag "EFS Path" "/user@host.domain:/directory/")
+          (remove
+           nil
+           (mapcar
+            (function
+             (lambda (entry)
+               (let (comment host path efs-path)
+                 (setq comment (nth 0 entry)
+                       host (nth 1 entry)
+                       path (nth 2 entry))
+                 (when
+                     (and host
+                          (not (string-equal comment "Pre-Releases")))
+                   (setq efs-path (format "/ftp@%s:/%s" host path))
+                   (list
+                    'const
+                    :tag (format "%s - %s" efs-path comment)
+                    (file-name-directory efs-path))))))
+            package-get-download-sites))))
   :group 'build-tarball)
 
 (defun build-tarball-expand (item)
     (custom-mode)
     (goto-char (point-min))))
 
-
-(defun build-call-process (command infile buffer displayp)
-  (let (exit-status result)
-    (with-temp-buffer
-      (condition-case signal
-          (setq exit-status
-                (apply 'call-process
-                       (append
-                        (list (car command) infile buffer displayp)
-                        (cdr command))))
-        (error
-         (warn "\n%s\ncannot be executed: %S %S\n"
-               (mapconcat 'identity command " ")
-               (car signal) (cdr signal))))
-      ;; return value of result
-      (setq result (cons exit-status (buffer-string))))))
-
 ;;}}}
 
 ;;{{{ Build With
   :group 'build-with-MS)
 
 (defcustom build-with-MS-make-options
-  "/f xemacs.mak"
+  '("/f xemacs.mak")
   "Options to use with Microsoft make utility when building XEmacs."
   :type '(repeat string)
   :group 'build-with-MS)
   (interactive)
   (let
       ((name "*Build XEmacs With GNU Tools*"))
+    ;; Overwrite any customized setting for this build session so
+    ;; that build-report will find the right information.
+    (customize-set-variable
+     'build-report-installation-file
+     (expand-file-name "Installation" dir))
+    (customize-set-variable
+     'build-report-version-file
+     (expand-file-name "version.sh" dir))
     (kill-buffer (get-buffer-create name))
     (switch-to-buffer (get-buffer-create name))
     (kill-all-local-variables)
     ;; Overwrite any customized setting for this build session so
     ;; that build-report will find the right information.
     (customize-set-variable
+     'build-report-installation-file
+     (expand-file-name
+      "Installation"
+      (expand-file-name
+       ".."
+       dir)))
+    (customize-set-variable
      'build-report-version-file
      (expand-file-name
       "version.sh"
          :activate
        :deactivate))
     (widget-insert
-     "\n\tXEmacs versions prior to 21.2-b32 do not use config.inc.\n\tThose are configured by passing all variable values to nmake\n\ton the command-line.\n\n")    
+     "\n\tXEmacs versions prior to 21.2-b32 do not use config.inc.\n\tThose are configured by passing all variable values to nmake\n\ton the command-line.\n\nDon't forget to save config.inc before building!")
     (widget-insert "\n\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)