Avi Bryant avi@beta4.com wrote: [Yet Another Installer] I'm getting overloaded with new and improved installers. Maybe add a Swiki pages explaining all the different package formats we're supporting, which I should use when, and a word on two on how?
Daniel - I had to ignore the #upgrade method on SMInstaller, because SMLoader only supports #install. Perhaps it should call #upgrade if there's an existing version in the image? Not that it mattered in this case (I can just check for an existing DVS package myself), but it might in others.
I delayed adding GUI for upgrade because there wasn't any actual model support. I will add it now if theres a significant difference between what upgrade and isntall should do, but I prefer to delay the issue a bit, until we have a services architecture that doesn't hardwire the possible actions in the GUI at all (which Goran said won't be in SM 1.0, but maybe in 1.1).
What do you say?
Daniel Vainsencher
Cheers, Avi
--Boundary_(ID_2WotAQ3dX3SIhBlIbsuaqg) Content-id: Pine.LNX.4.43L0.0210291929440.9010@cable.beta4.com Content-type: TEXT/PLAIN; charset=US-ASCII; name=SM-DVS.st Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=SM-DVS.st Content-description:
"SM-DVS"!
!SMInstaller class methodsFor: '*sm-dvs' stamp: 'ab 10/29/2002 18:55'!
classForPackage: aPackage
"Decide which subclass to instantiate.
We detect and retrurn the first subclass that wants to handle the package."
self subclasses do:
[:ea | (ea classForPackage: aPackage) ifNotNilDo: [:class | ^ class]].
^ (self canInstall: aPackage) ifTrue: [self]! !
Smalltalk organization
addCategory: 'SM-DVS';
yourself!
SMDefaultInstaller subclass: #SMDVSInstaller
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'SM-DVS'!
SMDVSInstaller class
instanceVariableNames: ''!
!SMDVSInstaller class methodsFor: 'as yet unclassified' stamp: 'ab 10/29/2002 19:00'!
canInstall: aPackage
^ "(super canInstall: aPackage)
and: [aPackage description includesSubString: 'DVS']" true! !
!SMDVSInstaller methodsFor: 'as yet unclassified' stamp: 'ab 10/29/2002 19:06'!
externalName
^ package downloadFileName sansPeriodSuffix! !
!SMDVSInstaller methodsFor: 'as yet unclassified' stamp: 'ab 10/29/2002 19:03'!
install
|info|
self download ifFalse: [^false].
self unpack ifFalse: [^ false].
(info _ self packageInfo)
ifNil: [self fileIn] ifNotNil: [self loadPackage: info].
^ true! !
!SMDVSInstaller methodsFor: 'as yet unclassified' stamp: 'ab 10/26/2002 14:27'!
loadPackage: packageInfo
|fileStream|
fileStream _ dir readOnlyFileNamed: unpackedFileName.
FilePackageLoader new
package: packageInfo; stream: fileStream; fileIn! !
!SMDVSInstaller methodsFor: 'as yet unclassified' stamp: 'ab 10/29/2002 19:05'!
packageInfo
^ PackageInfo allSubInstances detect: [:ea | ea externalName = self externalName]! !
Smalltalk at: #PackageInfo ifPresent: [:pi | pi registerPackage: 'SM-DVS'].!
--Boundary_(ID_2WotAQ3dX3SIhBlIbsuaqg)--
On Thu, 31 Oct 2002 danielv@netvision.net.il wrote:
I delayed adding GUI for upgrade because there wasn't any actual model support. I will add it now if theres a significant difference between what upgrade and isntall should do, but I prefer to delay the issue a bit, until we have a services architecture that doesn't hardwire the possible actions in the GUI at all (which Goran said won't be in SM 1.0, but maybe in 1.1).
What do you say?
Delaying it is fine with me.
squeak-dev@lists.squeakfoundation.org