[net.lang.st80] Smalltalk Notes 3: Producing a "Release" Image

rentsch@unc.UUCP (Tim Rentsch) (11/04/86)

Copyright(c) 1986, by Tim Rentsch

Copyright Notice:  This memo is Copyright(c) 1986, by Tim Rentsch.
Copies may be made and distributed provided all of the following
conditions are met:  one, the copyright notice be included in its
entirety; two, the memo be copied (or distributed) in its entirety;
three, the memo be copied (or distributed) individually, i.e., not in
collection with other material; four, copies be made and distributed
one at a time, i.e., copies cannot be made or distributed in batches
of more than one; five, copies may not be sold -- distributing copies
is to be done at no cost to the recipients of the copies.  (End of
conditions, and end of copyright notice.)  



Note # 3:  Preparing a 'Release' Image and Sources File
=======================================================

This is just a quick note, and some code to allow you to prepare a
"release" image complete with its own '.sources' file.  PS as
distributed (to us anyway) had a fairly long '.changes' file, and
some other things which made me think that a new image with a "clean
slate", so to speak, would be a good idea.  I came up with the
method enclosed, to do just that;  we use it now for preparing our
internal releases of new "standard images".

(For those of you with BS, this code was originally written for BS,
but had to be modified to run on PS.  I have installed from memory
the single extra line of code which we used when running BS, as a
comment.  This line may be wrong, and may not even be necessary.
But, what the heck, it's close, and the price is right.)

A word to the cognescenti:  the code given here does *not* clone an
image or use the system tracer.  (I have heard that there are
problems with this approach for some interpreters, but that is
another matter.)  Be that as it may, this is the code we use.  If
someone experiments with cloning images and comes up with another
method using the system tracer, please post it.  We are interested,
and I am sure others are as well.

The code given here is mildly entertaining to watch, for a while,
but it runs a long time (about one and a half hours on a sun2
running PS).  After it is done, you have a new image, '.sources'
file, and a tiny new '.changes' file.

Note that after it is done, you probably want to save the image
again, using the save command.  The reasons for doing this are: (1)
to clean up the display of the saved image (do this before using the
'save' command), and (2) otherwise the tail of this method will run
everytime the new image is started up.  I guess the best thing to do
would be to try running the new image as is a few times, and if you
don't like it, just use 'save' to produce the release image.

Running the code can be done, e.g., by using the comment contained
in the method given.

As usual, code follows the ....

(End of Note # 3)

--------------------------------CUT HERE--------------------------------
'From UNC Smalltalk-80, version 2.1, of October 26, 1986
 on 31 October 1986 at 3:13:27 pm'!

!SystemDictionary methodsFor: 'system backup/out'!

saveVersion: name
	"Save the whole shebang as name.im, name.sources, name.changes.
		This takes a long time, so be warned.  
		January 11, 1986,  by Tim Rentsch"

	"Smalltalk saveVersion: 'unc2-1'."

	| beginning end |
	beginning _ Date dateAndTimeNow.
	Transcript
		clear;
		show: 'Preparing new release version ', name;
		cr.
	self
		forgetDoIts;
		newSourceFile: name  without: (Array new);
		noChanges "; reorganize".   "BS code is in comment"
	Transcript clear.
	self  snapshotAs: name  thenQuit: false.
	end _ Date dateAndTimeNow.
	Transcript clear;
		show: 'Started at ',
			(beginning at: 1) printString, ' ',
			(beginning at: 2) printString;
		cr;
		show: 'Ended at ',
			(end at: 1) printString, ' ',
			(end at: 2) printString; cr.! !