[ENH] SM2Install-gk

goran.krampe at bluefish.se goran.krampe at bluefish.se
Mon Feb 16 19:28:11 UTC 2004


from preamble:

"Change Set:		SM2Install
Date:			12 February 2004
Author:			Göran Krampe

This changeset installs SM2 into the image by contacting the SM2 server
at map1.squeakfoundation.org and asking it for the URLs to the packages
to download and install.

It first installs VersionNumber and MCInstaller if needed."

| repDir server stream installedMC installedVN map |
installedVN _ false.
"Install first versions of VersionNumber for SM2 if it is missing, we
can't rely on using old SM because it is now removed."
(Smalltalk hasClassNamed: #VersionNumber) ifFalse: [
	ChangeSorter newChangesFromStream:
	
((('http://map1.squeakfoundation.org/sm/package/35e02e3a-48e2-4843-94ee-
e86d651aeafe/autoversion/1/downloadurl')
		asUrl retrieveContents content) asUrl retrieveContents content
unzipped
		readStream)	
	named: (ChangeSet uniqueNameLike: 'VersionNumber').
	installedVN _ true].

"Load the new SM base, using available Monticello or MCInstaller, and
installing MCInstaller otherwise"
stream _ HTTPClient httpGet:
	('http://map1.squeakfoundation.org/sm/package/c4c13ea3-e376-42c7-8d9e-d
c23b09f9f29/autoversion/6/downloadurl'
		asUrl retrieveContents content).

installedMC _ false.
(Smalltalk hasClassNamed: #MCMczReader)
	ifTrue: [(MCMczReader versionFromStream: stream) load "Using
Monticello"]
	ifFalse: [
		"No Monticello installed, will use MCInstaller and install it first if
needed"
		(Smalltalk hasClassNamed: #MczInstaller) ifFalse: [
			ChangeSorter
				newChangesFromStream:
				
((('http://map1.squeakfoundation.org/sm/package/af9d090d-2896-4a4e-82d0-
c61cf2fdf40e/autoversion/2/downloadurl')
				asUrl retrieveContents content) asUrl retrieveContents content
unzipped
				readStream)
			named: (ChangeSet uniqueNameLike: 'MCInstaller').
			installedMC _ true].
		MczInstaller installStream: stream].

"This clears the default map, but keeps info on installed packages if
there where any"
map _ (Smalltalk at: #SMSqueakMap) default.
map installedPackagesDictionary:
	(Smalltalk at: #SM1InstalledPackagesDictionary ifAbsent: [nil]).
Smalltalk removeKey: #SM1InstalledPackagesDictionary ifAbsent: [nil].
"Remove old SM Package Loader, if present"
map clearInstalledPackageWithId: '047a3b12-7e52-4c5d-be8b-d06635fc4f1c'.
"Remove old SqueakMap Base, if present"
map clearInstalledPackageWithId: 'fffa45d3-2459-4b7d-b594-9cfae17c864d'.
"Remove old SqueakMap loadscript, if present"
map clearInstalledPackageWithId: '4f0b9db6-8add-43aa-8d6b-53e6a0ea8442'.

"Add that we now have versions of SqueakMap2 base, VersionNumber and
MCInstaller installed"
map noteInstalledPackageWithId: 'c4c13ea3-e376-42c7-8d9e-dc23b09f9f29'
autoVersion: '6'.
installedVN ifTrue: [map noteInstalledPackageWithId:
'35e02e3a-48e2-4843-94ee-e86d651aeafe' autoVersion: '1'].
installedMC ifTrue: [map noteInstalledPackageWithId:
'af9d090d-2896-4a4e-82d0-c61cf2fdf40e' autoVersion: '2'].

"Make sure map is updated"
map loadUpdates.

"Install new SMLoader using SM2 itself."
map installPackageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3'
autoVersion: '2'
!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SM2Install-gk.cs.gz
Type: application/octet-stream
Size: 1260 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040216/fe9b97f5/SM2Install-gk.cs.obj


More information about the Squeak-dev mailing list