[squeak-dev] Update stream transition

David T. Lewis lewis at mail.msen.com
Sat Aug 22 14:15:44 UTC 2015


Currently we have the problem that an existing trunk image from prior
to the Squeak 4.6 release will lock up if the user does a normal
"update from server".  A knowledgeable user can work around this, as
with the script that Nicolas provides. But a year from now our tribal
knowledge is likely to dissipate, so I don't really like the idea of
having the original trunk update stream end in a frozen image.

I think I have come up with a way to have the update stream switch
automatically from trunk to squeak46 for existing images, see attached
change set. The idea is to add this class into a separate package
"Temp-update-strean-migration" in the trunk repository, and add that
package to the last update map that worked for V3 images (I think this
is update-eem.321.mcm, is that right?).  The package loads a class that
checks to see if the image needs to be switched from trunk to squeak46,
and changes the update preference accordingly.  It then removes itself
from the system.

Does this seem reasonable?

Dave



On Thu, Aug 06, 2015 at 10:24:31PM +0200, Nicolas Cellier wrote:
> 2015-08-06 16:47 GMT+02:00 Chris Muller <asqueaker at gmail.com>:
> 
> > > We currently have the trunk update stream, which is governed by update
> > maps
> > > called 'update' in the source.squeak.org/trunk repository. This update
> > > stream is applicable to Squeak images up to the initial release of the
> > > Squeak 4.6 image. These are images in the non-Spur image formats (6504
> > > or 6505 for 32-bit images, and 68002 for a 64-bit image).
> >
> > The .spur branch has already been collapsed onto trunk.  There is no
> > way to advance a non-spur image except through commits to the release
> > repositories (e.g., 'squea46').
> >
> >
> Hi,
> 
> FYI, I advanced the non spur with attached snippet (nothing really clever).
> 
> Cheers

> "update to latest cog version but not spur..."

| url repository updateList updater lastUpdateMap config |
url := MCMcmUpdater defaultUpdateURL.
repository := MCRepositoryGroup default repositories 
			detect:[:r| r description = url]
			ifNone:[ | r |
				r := MCHttpRepository location: url user: '' password: ''.
				MCRepositoryGroup default addRepository: r.
				r].
updater :=  [MCMcmUpdater default] ifError: [MCMcmUpdater].
lastUpdateMap := [updater lastUpdateMap] ifError: [MCMcmUpdater classPool at: #LastUpdateMap].
updateList := updater updateListFor: repository.
updateList := updateList select: [:e | e key < 323].
updateList := updater refreshUpdateMapFor: repository with: updateList.
updateList do:[:assoc|
				ProgressNotification signal: '' extra: 'Processing ', assoc value.
				config := repository versionNamed: assoc value.
				updater updateFromConfig: config.
				lastUpdateMap at: repository description put: assoc key.
			] displayingProgress: 'Processing configurations'.
config ifNil: [^updater inform: 'Unable to retrieve updates from remote repository.' translated].
config setSystemVersion.
updater inform: ('Update completed.
Current update number: ' translated, SystemVersion current highestUpdate).
> 

-------------- next part --------------
'From Squeak4.6 of 8 July 2015 [latest update: #15102] on 22 August 2015 at 9:47:23 am'!
"Change Set:		MoveTrunkEndToSqueak46RepoForV3Images-dtl
Date:			22 August 2015
Author:			David T. Lewis

The Squeak trunk development stream is transitioning to Spur image format. Existing V3 images that update from trunk need to avoid loading Spur-specific methods. Move the update preference for those images to the squeak46 maintenance repository. This class is intended to be loadedfrom a single update map in order to perform a one time update for V3 images, after which is serves no ongoing purpose. Therefore, following its initialization, it will delete itself from the system.

Note: The delete can be done in MoveTrunkEndToSqueak46RepoForV3Images class>>initialize. It may be preferable to move this to a package postscript."!

Object subclass: #MoveTrunkEndToSqueak46RepoForV3Images
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Temp-update-stream-migration'!

!MoveTrunkEndToSqueak46RepoForV3Images commentStamp: 'dtl 8/21/2015 19:31' prior: 0!
The Squeak trunk development stream is transitioning to Spur image format. Existing V3 images that update from trunk need to avoid loading Spur-specific methods. Move the update preference for those images to the squeak46 maintenance repository. This class is intended to be loadedfrom a single update map in order to perform a one time update for V3 images, after which is serves no ongoing purpose. Therefore, following its initialization, it will delete itself from the system.

	"MoveTrunkEndToSqueak46RepoForV3Images checkAndChangeUpdateStream"
!


!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'update stream migration' stamp: 'dtl 8/21/2015 18:57'!
checkAndChangeUpdateStream
	"Change the update stream preference to squeak46 if this image cannot follow Spur updates."
	
	(((self isSqueakV3
			and: [self isUsingTrunkUpdateStream]))
				and: [self isAtEndOfV3Updates])
		ifTrue: ["change from trunk to http://source.squeak.org/squeak46"
			MCMcmUpdater defaultUpdateURL: 'http://source.squeak.org/squeak46'].
	^ 'updates from ', MCMcmUpdater updateMapName, ' at ', MCMcmUpdater defaultUpdateURL
! !

!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'testing' stamp: 'dtl 8/21/2015 18:39'!
isAtEndOfV3Updates
	"The update number for the Squeak 4.6 release image is 15102. Answer true if this image
	is at that level or greater."

	^ SystemVersion current highestUpdate >= 15102! !

!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'testing' stamp: 'dtl 8/21/2015 17:56'!
isSqueakV3
	"True if this image is in a pre-Spur object format"
	| formats |
	formats := #(
		6504	"32-bit V3 with traditional float ordering"
		6505	"32-bit V3 with platform float ordering (Cog VM)"
		68002	"64-bit V3 with traditional float ordering"
		68003	"64-bit V3 with platform float ordering (mythical)"
	)..
	^ formats includes: Smalltalk imageFormatVersion! !

!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'testing' stamp: 'dtl 8/21/2015 18:06'!
isUsingTrunkUpdateStream
	"True if the update preferences specify the trunk stream"

	^ ( 'http://source.squeak.org/trunk' = MCMcmUpdater defaultUpdateURL )
		and: [ 'update' = MCMcmUpdater updateMapName ]! !

!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'class initialization' stamp: 'dtl 8/21/2015 20:24'!
destroy
	"Remove this class from the system after it has served its purpose"

	| category |
	category := self category.
	self removeFromSystem.
	SystemOrganization futureDo: #removeCategory: at: 1000 args: { category } 
! !

!MoveTrunkEndToSqueak46RepoForV3Images class methodsFor: 'class initialization' stamp: 'dtl 8/21/2015 19:28'!
initialize
	"This class is intended to be loaded and initialized from a specific update map. After
	performing the update stream check, remove this class from the system."

	self checkAndChangeUpdateStream.
	self destroy
! !

MoveTrunkEndToSqueak46RepoForV3Images initialize!


More information about the Squeak-dev mailing list