Wrinting a script to load packages from Monticello

Damien Cassou damien.cassou at laposte.net
Fri May 5 14:20:57 UTC 2006

Here is my script that loads things like magritte, ecompletion, shout, 
seaside, pier...

Fell free to comment it.

Damien Cassou

-------------- next part --------------
| 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