[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

world management and patches

    Date: Thu, 28 Jul 88 20:00 EDT
    From: cjl@WHEATIES.AI.MIT.EDU (Chris Lindblad)

	Date: Thu, 23 Jun 88 10:36 EDT
	From: SWM@SAPSUCKER.SCRC.Symbolics.COM (Scott McKay)

	    Date: Wed, 22 Jun 88 13:23 CDT
	    From: Gumby@MCC.COM (David Vinayak Wallace)

	    But they don't give you any tool for 1creating0 ECOs, so you can't use it
	    to distribute patches to your own systems.

	m-X Start/Add/Finish Patch is how we create ECOs, except that we
	include, by hand, a form at the top of the patch file, 2sct:define-eco0.
	The sole purpose of that form is to make the herald and :Show ECOs print
	something that indicates that there are ECO patches.

    Unless I missed something, this still is not enough to make mail message ECOs
    that can be decoded with the ZMAIL command "Decode ECO".  How do you make a
    mail message ECO from a distribution tape ECO?

    It would also be nice if the file sys:zmail;eco-commands.lisp were on the next
    eco tape.

We didn't include the encoding stuff because it was not adequately
tested.  In fact, I know of several bugs.  Including it in 7.2 would
have constituted a promise to support it, which promise we are not ready
to make.

The ECO tape included the entire source of SYS:IO1;ENCODE-BINARY-FILES,
even if the patches did not.  The following is the entire source of

Please, do not expect to have bugs fixed in this.  The 1only0 thing you
can count on working is encoding and decoding a distribution "tape"
which has been made using the :Use Disk keyword to :Distribute Systems.

;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10; Package: ZWEI; Lowercase: Yes -*-

;;;> *****************************************************************************************
;;;> ** (c) Copyright 1988, 1987, 1986 Symbolics, Inc.  All rights reserved.
;;;> ** Portions of font library Copyright (c) 1984 Bitstream, Inc.  All Rights Reserved.
;;;>    The software, data, and information contained herein are proprietary 
;;;> to, and comprise valuable trade secrets of, Symbolics, Inc., which intends 
;;;> to keep such software, data, and information confidential and to preserve 
;;;> them as trade secrets.  They are given in confidence by Symbolics pursuant 
;;;> to a written license agreement, and may be used, copied, transmitted, and 
;;;> stored only in accordance with the terms of such license.
;;;> Symbolics, Symbolics 3600, Symbolics 3670 (R), Symbolics 3675 (R), Symbolics 3630,
;;;> Symbolics 3640, Symbolics 3645 (R), Symbolics 3650 (R), Symbolics 3620 (R), Symbolics 
;;;> 3610 (R), Symbolics Common Lisp (R), Symbolics-Lisp (R), Zetalisp (R), Genera (R),
;;;> Wheels, Dynamic Windows (R), Showcase, SmartStore, Semanticue, Frame-Up, Firewall (R),
;;;> Newsletter (R), Document Examiner (R), S-DYNAMICS (R), S-GEOMETRY (R), S-PAINT (R),
;;;> S-RENDER (R), "Your Next Step in Computing" (R), Ivory, Symbolics C, Symbolics Pascal,
;;;> and Symbolics Fortran are trademarks of Symbolics, Inc.
;;;>    Use, duplication, and disclosure by the Government are subject to restrictions 
;;;> as set forth in subdivision (c)(1)(ii) of the Rights in Trademark Data and Computer 
;;;> Software Clause at FAR 52.227-7013.
;;;>      Symbolics, Inc.
;;;>      11 Cambridge Center
;;;>      Cambridge, Massachusetts  02142
;;;>      United States of America
;;;>      617-621-7500
;;;> *****************************************************************************************

(define-zmail-top-level-command com-zmail-make-encoded-ECO-file
    "Encode a file (presumably a quasi-distribution-tape) and put the result in another file."
  (let* ((input (accept-defaulted-pathname "Encode file for ECO" (default-pathname)))
	 (output (accept-defaulted-pathname
		   "Pathname of result" (send input :new-type :encode) :direction :write)))
    (with-open-file (i input
		       :direction :input
		       :characters :default)
      (with-open-file (o output
			 :direction :output)
	(cli::encode-data-as-ascii i o))))

(defvar *mail-ECO-encoded-file* nil)

(define-zmail-top-level-command com-zmail-mail-eco
    "Encode a file, if necessary, and put encoded ASCII into a message draft."
  (let ((eco-file (accept-defaulted-pathname "Get ECO material from file" (default-pathname))))
    (with-open-file (i eco-file
		     :direction :input
		     :characters :default)
      (condition-case ()
	   (cli::read-encoded-file-preamble i)
	   (format t "The file ~A has not been encoded~@
                ~2T for mail ECO transmission.  Please name a file for the encoded result."
	   (let ((output (accept-defaulted-pathname
			   "Pathname for encoded output" (send eco-file :new-type :encode)
			   :direction :write)))
	     (with-open-file (i eco-file
			      :direction :input
			      :characters :default)
	       (with-open-file (o output
				:direction :output)
		 (cli::encode-data-as-ascii i o)))
	     (setq eco-file output)))))
    (let ((*mail-eco-encoded-file* eco-file))
      (compose-from-template 'mail-eco-mail-template))))

(defvar *ECO-greeting* "        *** Software ECO Distribution ***
     by electronic mail, from Symbolics, Inc.

>> To restore this distribution, please use the Zmail command

        m-X Decode ECO

   It will save the decoded distribution in the file named in the 
   encoded body.  It will also offer to do Restore Distribution from
   this file. 

(defvar *ECO-delimiter*
	"  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

;; Mostly copied from Compatible Mail Template
(deftemplate mail-eco-mail-template
  (:type :compatible-mail)
  (:name "ECO mail")
  (:documentation "Mail an ECO with compatible special variable user options.")
  (:header-field :to (prompt-for-addresses "To:"))
  (:header-field :subject "Software ECO Distribution")
  (:text (string-append *eco-greeting* *eco-delimiter*
			(with-output-to-string (s)
			  (with-open-file (i *mail-eco-encoded-file*
					     :direction :input :characters :default)
			    (si:stream-copy-until-eof i s)))
  (:starting-point :reply)) 

(define-zmail-top-level-command com-zmail-decode-eco
    "Decode a message as a Software ECO Distribution, into the file named in the encoded body.
Offer to do Restore Distribution on this file."
  (flet ((bad-eco-barf (&optional error)
	   (barf "This message does not appear to be a valid Software ECO Distribution~@[:~@
                  ~2T~~A~~]." error)))
    (let ((encoded-start-bp (search (msg-start-bp *msg*) *eco-delimiter*))
	  (pathname nil)
	  (restore-dist nil))
      (unless encoded-start-bp
      (let ((encoded-end-bp (search encoded-start-bp *eco-delimiter*)))
	(unless encoded-end-bp
	  (bad-eco-barf "Could not find a pair of encoded-ECO delimiters"))
	(setq encoded-end-bp (search encoded-end-bp *eco-delimiter* t))	;back over it
	(condition-case (error)
	       (setq pathname (with-interval-stream (s encoded-start-bp encoded-end-bp t)
				(cli::read-encoded-file-preamble s)))
	       (format query-io "~&The decoded ECO will be stored in ~A." pathname)
	       (setq restore-dist
		     (yes-or-no-p "Should I do a :Restore Distribution from that file, too? "))
	       (setq pathname
		     (with-interval-stream (s encoded-start-bp encoded-end-bp t)
		       (cli::decode-data-from-ascii s))))
	   (cli::ascii-decoding-data-error (bad-eco-barf error)))
	(format t "~&Decoded ECO stored in ~A." pathname)
	(if restore-dist
	    (progn (format t "~&Restoring distribution from ~A." pathname)
		   ;;--- This awful kludge [let - flet - letf] is made necessary by
		   ;;--- insufficient smarts in the released version of
		   ;;--- dis:open-input-distribution-tape-access-path.  Be sure to change
		   ;;--- it to do this dwimification in the next release. -- Dodds 5/02/88
		   (let ((old-open-input-distribution-tape-access-path
		     (flet ((new-open-input-distribution-tape-access-path (&optional
									    use-disk path)
			      (when (and (null path) (typep use-disk 'fs:pathname))
				(setq path use-disk
				      use-disk t))
			      (funcall old-open-input-distribution-tape-access-path
				       use-disk path)))
		       (letf ((#'dis:open-input-distribution-tape-access-path
			 (dis:restore-distribution-from-tape :use-disk pathname))))
		   (format t "~&Distribution restored.  Do :Load Patches to ~
                              install the ECO in the running world."))
	  (format t "~&Don't forget to :Restore Distribution :Use Disk Yes,~@
                     ~2Tusing the file ~A,~@
                     ~2Tthen :Load Patches to install the ECO in the running world."