[squeak-dev] The Trunk: MonticelloConfigurations-nice.151.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Apr 8 11:54:15 UTC 2017


Nicolas Cellier uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-nice.151.mcz

==================== Summary ====================

Name: MonticelloConfigurations-nice.151
Author: nice
Time: 8 April 2017, 1:53:22.973832 pm
UUID: ef900bfc-3db9-4ffa-80b6-85e05ae320bd
Ancestors: MonticelloConfigurations-ul.150

Duplicate a few methods with an additional (upTo: versionNumber) parameter, so as to be able to write convenient things like:

    MCMcmUpdater default doUpdateUpTo: 406.

This would require better refactoring rather than duplication, but I want to experiment fast for restoring the update process fast.

=============== Diff against MonticelloConfigurations-ul.150 ===============

Item was added:
+ ----- Method: MCMcmUpdater>>doUpdate:upTo: (in category 'updating') -----
+ doUpdate: interactive upTo: versionNumber
+ 	"Update the image by loading all pending updates from the server. If this is
+ 	the default updater for the system, update the system version when complete.
+ 	If interteractive use a modal notifier, otherwise only update the transcript.
+ 	Flush all caches. If a previous download failed this is often helpful"
+ 
+ 	| config previousUpdateLevel |
+ 	previousUpdateLevel := SystemVersion current highestUpdate.
+ 	MCFileBasedRepository flushAllCaches.
+ 	config := self updateFromRepositories: { self repository } upTo: versionNumber.
+ 	config ifNil: [
+ 		interactive ifTrue: [ ^self inform: 'Unable to retrieve updates from remote repository.' translated ].
+ 		Transcript cr; show: '==========  Unable to retrieve updates from remote repository. ==========' translated; cr.
+ 		^ self ].
+ 	MCMcmUpdater default == self
+ 		ifTrue: [
+ 			config setSystemVersion.
+ 			interactive ifTrue: [ 
+ 				self inform: ('Update completed.\\Version: {1}\Update: {3}{2}\\Url: {4}\Map: ''{5}''{6}' translated withCRs format: {
+ 						SystemVersion current version.
+ 						SystemVersion current highestUpdate.
+ 						previousUpdateLevel = SystemVersion current highestUpdate
+ 							ifTrue: ['']
+ 							ifFalse: [previousUpdateLevel asString, ' -> '].
+ 						self repository.
+ 						MCMcmUpdater updateMapName.
+ 						SystemVersion current description ifEmpty: [''] ifNotEmpty: [:d | String cr, String cr, d]})].
+ 			Transcript cr;
+ 				show: '==========  Update completed:  ' translated;
+ 				show: previousUpdateLevel;
+ 				show: ' -> ' ;
+ 				show: SystemVersion current highestUpdate;
+ 				show: ' =========='; cr ]
+ 		ifFalse: [
+ 			interactive
+ 				ifTrue: [ self inform: 'Update completed.' ].
+ 			Transcript cr; show: '==========  Update completed. ==========' translated; cr ]
+ 	!

Item was added:
+ ----- Method: MCMcmUpdater>>doUpdateUpTo: (in category 'updating') -----
+ doUpdateUpTo: versionNumber
+ 	"Update the image by loading all pending updates from the server. If this is
+ 	the default updater for the system, update the system version when complete.
+ 	Flush all caches. If a previous download failed this is often helpful"
+ 
+ 	^self doUpdate: true upTo: versionNumber
+ !

Item was added:
+ ----- Method: MCMcmUpdater>>updateFromRepositories:upTo: (in category 'updating') -----
+ updateFromRepositories: repositoryUrls upTo: versionNumber
+ 	"MCMcmUpdater updateFromRepositories: #(
+ 		'http://squeaksource.com/MCUpdateTest'
+ 	)"
+ 
+ 	| repos config |
+ 	MCConfiguration upgradeIsMerge: true.
+ 	"The list of repositories to consult in order"
+ 	repos := repositoryUrls collect:[:url| 
+ 		MCRepositoryGroup default repositories 
+ 			detect:[:r| r description = url]
+ 			ifNone:[ | r |
+ 				r := MCHttpRepository location: url user: '' password: ''.
+ 				MCRepositoryGroup default addRepository: r.
+ 				r]].
+ 
+ 	"The list of updates-author.version.mcm sorted by version"
+ 	repos do:[ :r | config := self updateFromRepository: r upTo: versionNumber].
+ 	^config!

Item was added:
+ ----- Method: MCMcmUpdater>>updateFromRepository:upTo: (in category 'updating') -----
+ updateFromRepository: repository upTo: versionNumber
+ 
+ 	| config |
+ 	repository cacheAllFileNamesDuring: [ | updateList |
+ 		updateList := self updateListFor: repository.
+ 		"Proceed only if there are updates available at all."
+ 		updateList ifNotEmpty: [
+ 			updateList := self refreshUpdateMapFor: repository with: updateList.
+ 			"Now process each update file. Check if we have all dependencies and if not,
+ 			load the entire configuration (this is mostly to skip older updates quickly)"
+ 			updateList do:[:assoc|
+ 				assoc key > versionNumber ifTrue: [^config].
+ 				ProgressNotification signal: '' extra: 'Processing ', assoc value.
+ 				config := repository versionNamed: assoc value.
+ 				self updateFromConfig: config.
+ 				self lastUpdateMap at: repository description put: assoc key.
+ 			] displayingProgress: 'Processing configurations'.
+ 		]].
+ 	^config
+ !



More information about the Squeak-dev mailing list