One-Click 1.0-beta.8.6 GemTools
GLASS Upgrade Cha Cha
I suppose it is a little known fact that the GemTools code base includes code that is used to drive the GLASS upgrade process, although my constant entreaties to “upgrade GemTools to the latest version before upgrading GLASS” may have given you a clue or two.
I thought I’d take this opportunity to describe what goes on behind the scenes when you select the Update > Update GLASS menu item in GemTools. This section should be especially useful if you prefer to upgrade your system without running GemTools.
Through the ‘Update GLASS’
Currently Metacello 1.0-beta.31.1 is the version that is needed for a smooth upgrade process:
ConfigurationOfMetacello project currentVersion versionNumber < '1.0-beta.31.1' asMetacelloVersionNumber ifTrue: [ (Gofer new) gemsource: 'metacello'; version: 'Gofer-Core.gemstone-dkh.135'; version: 'Metacello-Base-DaleHenrichs.19'; version: 'Metacello-Core-dkh.468'; version: 'Metacello-MC-dkh.531'; version: 'Metacello-Platform.gemstone-dkh.23'; load ].
It turns out that the best formula for bootstrapping Metacello is to directly load the key packages. I would have liked to use Metacello to bootstrap itself, but for GLASS we need to upgrade a wide range of Metacello releases dating back to over a year ago and there are several bugs that make it impractical to do anything but load the packages directly.
To bootstrap Monticello, we use the GLASS configuration and load the ‘Core’ and ‘Monticello’ projects:
MCPlatformSupport commitOnAlmostOutOfMemoryDuring: [[[ (ConfigurationOfGLASS project version: '1.0-beta.8.7.1') load: #( 'Core' 'Monticello' ) ] on: MetacelloSkipDirtyPackageLoad do: [:ex | ex resume: false ]] on: Warning do: [:ex | Transcript cr; show: ex description. ex resume ]].
We wrap the load with an out-of-memory handler.
The MetacelloSkipDirtyPackageLoad handler is there to compensate for a bug in the Monticello package loader that occasionally resulted in a package being marked dirty after a successful load.
The Warning handler is also there to ensure that packages needed for the upgrade are loaded whether or not they are marked dirty.
The GLASS upgrade is completed by doing a simple load:
MCPlatformSupport commitOnAlmostOutOfMemoryDuring: [[[ (ConfigurationOfGLASS project version: '1.0-beta.8.7.1') load ] on: MetacelloSkipDirtyPackageLoad do: [:ex | ex resume: false ]] on: Warning do: [:ex | Transcript cr; show: ex description. ex resume ]].