SMDVSInstaller

Avi Bryant avi at beta4.com
Wed Oct 30 03:29:44 UTC 2002


On Tue, 29 Oct 2002, Avi Bryant wrote:

>
> On Tue, 29 Oct 2002 goran.hultgren at bluefish.se wrote:
>
> > > (I don't necessarily recommend updating through SqueakMap, though - better
> > > would be to file it in clean to a new image.  Need to get that
> > > SMDVSInstaller going...)

Ok, attached is an SMDVSInstaller.  It's very minimal, but if you have
DVS, SqueakMap and Seaside 2.02 installed, you should be able to:

- file in SM-DVS.st
- open the SMLoader
- find Seaside (now at version 2.03), right click and choose "install"

DVS will look for differences between the version of Seaside you have in
your image and the version currently posted on SqueakMap, and will
generate and fileIn a changeset with those differences (beware - this
means that any classes you've added to the Seaside categories will
disappear).  In other words, it won't just file over your current version,
but will bring it precisely in sync with what's on SqueakMap.

This fileOut also includes the change to
SMInstaller class>>classForPackage: from my previous email.

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.

Cheers,
Avi
-------------- next part --------------
"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'].!


More information about the Squeak-dev mailing list