Commits

Anonymous committed eec31c5

packages: Bug fix and minor improvements for build package

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

xemacs-packages/build/ChangeLog addition:

2003-01-11 Adrian Aichner <adrian@xemacs.org>

* Makefile (AUTHOR_VERSION): Increment.
* build.el: Remove commented code.
* build.el (build): Provide package before requiring others.
* build.el (build-cvs-get-branch-and-release-tags): Use temp
buffer to avoid changing directory of current buffer.
* build.el (build-cvs-xemacs-release): Improve docstring.
* build.el (build-from-CVS): Improve "Go Back" button notify function.
* build.el (build-from-tarballs): Ditto.
* build.el (build-with-GNU): Ditto.
* build.el (build-with-MS): Ditto.
* build.el (build-build-report): Ditto.

Comments (0)

Files changed (3)

+2003-01-11  Adrian Aichner  <adrian@xemacs.org>
+
+	* Makefile (AUTHOR_VERSION): Increment.
+	* build.el: Remove commented code.
+	* build.el (build): Provide package before requiring others.
+	* build.el (build-cvs-get-branch-and-release-tags): Use temp
+	buffer to avoid changing directory of current buffer.
+	* build.el (build-cvs-xemacs-release): Improve docstring.
+	* build.el (build-from-CVS): Improve "Go Back" button notify function.
+	* build.el (build-from-tarballs): Ditto.
+	* build.el (build-with-GNU): Ditto.
+	* build.el (build-with-MS): Ditto.
+	* build.el (build-build-report): Ditto.
+
 2003-01-03  Rendhalver [Peter Brown]  <rendhalver@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.09 released.
 # building without Mule.
 
 VERSION = 1.09
-AUTHOR_VERSION = 2.01
+AUTHOR_VERSION = 2.02
 MAINTAINER = Adrian Aichner <adrian@xemacs.org>
 PACKAGE = build
 PKG_TYPE = regular
 
 ;;}}}
 
-;;{{{ require/provide
+;;{{{ provide/require
+
+(provide 'build)
 
 (require 'custom)
 (require 'cus-edit)
     (require 'pcl-cvs)
   (error nil))
 
-(provide 'build)
-
 ;;}}}
 
 (defcustom build-from-what
        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)
+    (with-temp-buffer
+      (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 co-command infile buffer displayp))
+	    (build-call-process status-command infile buffer displayp))
       (cond
        ((null (car result))
-        (warn "\nprogram %s cannot be found or executed\n"
-              (car co-command)))
+	(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 co-command " ")
-              (cdr result)))
+	(warn "\n%s\nfailed with following output:\n%s\n"
+	      (mapconcat 'identity status-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)))
+	(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
 (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.  The list of available releases is updated via
-cvs, if installed, when `build' is started."
+The list of available releases is updated via cvs, if installed, by
+`build-from-CVS'.  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
                  (string :tag "Unlisted Release Name" "")
                  (const :tag "release-21-1 (branch: 1.165.2)" "release-21-1")
     (widget-insert "\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)
-                             (switch-to-buffer "*Build XEmacs*"))
+                             (let
+                                 ((buffer-back "*Build XEmacs*"))
+                               (if (buffer-live-p (get-buffer buffer-back))
+                                   (switch-to-buffer buffer-back)
+                                 (build))))
                    "Go Back")
     (widget-insert
      "\nYou need to customize CVS options and then download a release\nof XEmacs.\n\n")
     (widget-insert "\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)
-                             (switch-to-buffer "*Build XEmacs*"))
+                             (let
+                                 ((buffer-back "*Build XEmacs*"))
+                               (if (buffer-live-p (get-buffer buffer-back))
+                                   (switch-to-buffer buffer-back)
+                                 (build))))
                    "Go Back")
     (widget-insert
      "\nYou need to customize Tarball options and then download a beta/release\nversion of XEmacs.\n\n")
     (widget-insert "\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)
-                             (switch-to-buffer
-                              (cond
-                               ((string-equal build-from-what "Tarballs")
-                                "*Build XEmacs From Tarballs With GNU Tools*")
-                               ((string-equal build-from-what "CVS")
-                                "*Build XEmacs From CVS With GNU Tools*"))))
+                             (let
+                                 (buffer-back get-back)
+			       (cond
+				((string-equal build-from-what "Tarballs")
+				 (setq buffer-back "*Build XEmacs From Tarballs With GNU Tools*")
+				 (setq get-back 'build-from-tarballs))
+				((string-equal build-from-what "CVS")
+				 (setq buffer-back "*Build XEmacs From CVS With GNU Tools*")
+				 (setq get-back 'build-from-CVS)))
+                               (if (buffer-live-p (get-buffer buffer-back))
+                                   (switch-to-buffer buffer-back)
+                                 (funcall get-back))))
                    "Go Back")
     (widget-insert "\n\n")
     (widget-create 'push-button
     (widget-insert "\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)
-                             (switch-to-buffer
-                              (cond
-                               ((string-equal build-from-what "Tarballs")
-                                "*Build XEmacs From Tarballs With Microsoft Tools*")
-                               ((string-equal build-from-what "CVS")
-                                "*Build XEmacs From CVS With Microsoft Tools*"))))
+                             (let
+                                 (buffer-back get-back)
+			       (cond
+				((string-equal build-from-what "Tarballs")
+				 (setq buffer-back "*Build XEmacs From Tarballs With Microsoft Tools*")
+				 (setq get-back 'build-from-tarballs))
+				((string-equal build-from-what "CVS")
+				 (setq buffer-back "*Build XEmacs From CVS With Microsoft Tools*")
+				 (setq get-back 'build-from-CVS)))
+                               (if (buffer-live-p (get-buffer buffer-back))
+                                   (switch-to-buffer buffer-back)
+                                 (funcall get-back))))
                    "Go Back")
     (widget-insert "\n")
     (widget-insert
     (widget-insert "\n")
     (widget-create 'push-button
                    :notify (lambda (&rest ignore)
-                             (switch-to-buffer
-                              (cond
-                               ((string-equal build-with-what "GNU Tools")
-                                "*Build XEmacs With GNU Tools*")
-                               ((string-equal build-with-what "Microsoft Tools")
-                                "*Build XEmacs With Microsoft Tools*"))))
+                             (let
+                                 (buffer-back get-back dir)
+			       (cond
+				((string-equal build-with-what "GNU Tools")
+				 (setq buffer-back "*Build XEmacs With GNU Tools*")
+				 (setq get-back 'build-with-GNU))
+				((string-equal build-with-what "Microsoft Tools")
+				 (setq buffer-back "*Build XEmacs With Microsoft Tools*")
+				 (setq get-back 'build-with-MS)))
+			       (cond
+				((string-equal build-from-what "Tarballs")
+				 (setq dir
+				       (expand-file-name
+					build-tarball-prefix
+					build-tarball-dest)))
+				((string-equal build-from-what "CVS")
+				 (setq dir
+				       (expand-file-name
+					build-cvs-checkout-dir
+					build-cvs-checkout-parent-dir))))
+                               (if (buffer-live-p (get-buffer buffer-back))
+                                   (switch-to-buffer buffer-back)
+                                 (funcall get-back dir))))
                    "Go Back")
     (widget-insert "\n\n")
     (widget-create 'push-button
     (set (car var) (eval (car (cdr var))))
     ))
 
-;     (with-output-to-temp-buffer "*Build Settings*"
-;     (switch-to-buffer-other-window (current-buffer))
-
 ;;}}}
 
 ;; build.el ends here