Wrinting a script to load packages from Monticello

stéphane ducasse ducasse at iam.unibe.ch
Fri May 5 15:36:06 UTC 2006


It would be nice to improve the interface of the various classes so  
that we can write such script in a much less verbose way.
It looks like assembly somehow.

Stef

On 5 mai 06, at 16:20, Damien Cassou wrote:

> Here is my script that loads things like magritte, ecompletion,  
> shout, seaside, pier...
>
> Fell free to comment it.
>
> -- 
> Damien Cassou
>
> | map |
> Transcript openLabel: 'Transcript'.
> map := SMSqueakMap default.
> map loadUpdates.
>
> #('DynamicBindings' 'KomServices' 'KomHttpServer' 'Shout'  
> 'ShoutWorkspace' 'eCompletion') do:
> 	[ :package |
> 		map installPackageRelease: (map packageWithNameBeginning:  
> package) lastPublishedRelease].
>
> #(#('Seaside2.6a3' 'http://www.squeaksource.com/Seaside') # 
> ('Scriptaculous' 'http://www.squeaksource.com/Seaside') #('Magritte- 
> All' 'http://mc.lukas-renggli.ch/magritte') #('Pier-All' 'http:// 
> mc.lukas-renggli.ch/pier')) do:
> 	[:package | | repository version url fileToLoad sortMczs  
> userString passwordString|
> 	fileToLoad _ nil.
> 	userString _ ''.
> 	passwordString _ ''.
> 	url _ package second asUrl asString.
> 	
> 	repository _ MCHttpRepository location: url user: userString  
> password: passwordString.
> 	sortMczs _ [:a :b |
> 		[(a findBetweenSubStrs: #($.)) allButLast last asInteger > (b  
> findBetweenSubStrs: #($.)) allButLast last asInteger]
> 		on: Error do: [:ex | false]].
>
> 	fileToLoad _ (repository readableFileNames asSortedCollection:  
> sortMczs) detect:
> 			[:file | file beginsWith: package first].
>
> 	version _ repository versionFromFileNamed: fileToLoad.
> 	version workingCopy repositoryGroup addRepository: repository.
> 	repository creationTemplate: 'MCHttpRepository
> 	location: ''', url, '''
> 	user: ''', userString, '''
> 	password: ''', passwordString, ''''.
>
> 	version load].
>
> Transcript cr; show: 'Everything installed'; cr.




More information about the Squeak-dev mailing list