[squeak-dev] The Trunk: MonticelloConfigurations-dtl.129.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 10 03:15:24 UTC 2015


David T. Lewis uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-dtl.129.mcz

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

Name: MonticelloConfigurations-dtl.129
Author: dtl
Time: 9 April 2015, 11:15:18.378 pm
UUID: a3862e40-7029-4a52-9d4f-62aaaa8767ff
Ancestors: MonticelloConfigurations-bf.128

MCMcmUpdater class>>updateFromRepositories: has accumulated various enhancements and now wants to be factored into smaller methods.

=============== Diff against MonticelloConfigurations-bf.128 ===============

Item was added:
+ ----- Method: MCMcmUpdater class>>refreshUpdateMapFor:with: (in category 'updating') -----
+ refreshUpdateMapFor: r with: updateList
+ 	"Update the LastUpdateMap and answer a possibly reduced updateList"
+ 
+ 	| config |
+ 	(LastUpdateMap at: r description ifAbsent: [0]) = 0 ifTrue: [
+ 		"No update has ever been loaded from this repo. If no package is
+ 		present in the image either, we can skip right to the latest config"
+ 		config := r versionNamed: updateList last value.
+ 		(config dependencies anySatisfy: [:dep| dep package hasWorkingCopy])
+ 			ifFalse: [ (self useLatestPackagesFrom: r)
+ 				ifTrue: [LastUpdateMap at: r description put: updateList last key.
+ 					 ^ #()]
+ 				ifFalse: [ ^ updateList last: 1]]].
+ 	^ updateList
+ !

Item was added:
+ ----- Method: MCMcmUpdater class>>updateFromConfig: (in category 'updating') -----
+ updateFromConfig: config
+ 
+ 	"Skip packages that were specifically unloaded"
+ 	config dependencies: (config dependencies 
+ 		reject: [:dep| self skipPackages includes: dep package name]).
+ 	self updateMissingPackages ifFalse:[
+ 		"Skip packages that are not in the image"
+ 		config dependencies: (config dependencies 
+ 			select: [:dep| dep package hasWorkingCopy])].
+ 	(config dependencies allSatisfy:[:dep| dep isFulfilled]) 
+ 		ifFalse:[config upgrade].
+ !

Item was changed:
  ----- Method: MCMcmUpdater class>>updateFromRepositories: (in category 'updating') -----
  updateFromRepositories: repositoryUrls
  	"MCMcmUpdater updateFromRepositories: #(
  		'http://squeaksource.com/MCUpdateTest'
  	)"
  
  	| repos config |
  	MCConfiguration upgradeIsMerge: true.
  	LastUpdateMap ifNil:[LastUpdateMap := Dictionary new].
  	"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 ].
- 	repos do:[:r| r cacheAllFileNamesDuring:[
- 		| updateList |
- 		updateList := self updateListFor: r.
- 		"Proceed only if there are updates available at all."
- 		updateList ifNotEmpty: [
- 			(LastUpdateMap at: r description ifAbsent: [0]) = 0 ifTrue: [
- 				"No update has ever been loaded from this repo. If no package is
- 				present in the image either, we can skip right to the latest config"
- 				config := r versionNamed: updateList last value.
- 				(config dependencies anySatisfy: [:dep| dep package hasWorkingCopy])
- 					ifFalse: [ (self useLatestPackagesFrom: r)
- 						ifTrue: [LastUpdateMap at: r description put: updateList last key.
- 							updateList := #()]
- 						ifFalse: [updateList := updateList last: 1]]].
- 			"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|
- 				ProgressNotification signal: '' extra: 'Processing ', assoc value.
- 				config := r versionNamed: assoc value.
- 				"Skip packages that were specifically unloaded"
- 				config dependencies: (config dependencies 
- 					reject: [:dep| self skipPackages includes: dep package name]).
- 				self updateMissingPackages ifFalse:[
- 					"Skip packages that are not in the image"
- 					config dependencies: (config dependencies 
- 						select: [:dep| dep package hasWorkingCopy])].
- 				(config dependencies allSatisfy:[:dep| dep isFulfilled]) 
- 					ifFalse:[config upgrade].
- 				LastUpdateMap at: r description put: assoc key.
- 			] displayingProgress: 'Processing configurations'.
- 			"We've loaded all the provided update configurations.
- 			Use the latest configuration to update all the remaining packages."
- 			(self useLatestPackagesFrom: r) ifTrue: [
- 				config updateFromRepositories.
- 				config upgrade].
- 		]].
- 	].
  	^config!

Item was added:
+ ----- Method: MCMcmUpdater class>>updateFromRepository: (in category 'updating') -----
+ updateFromRepository: repository
+ 
+ 	| 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|
+ 				ProgressNotification signal: '' extra: 'Processing ', assoc value.
+ 				config := repository versionNamed: assoc value.
+ 				self updateFromConfig: config.
+ 				LastUpdateMap at: repository description put: assoc key.
+ 			] displayingProgress: 'Processing configurations'.
+ 			"We've loaded all the provided update configurations.
+ 			Use the latest configuration to update all the remaining packages."
+ 			(self useLatestPackagesFrom: repository) ifTrue: [
+ 				config updateFromRepositories.
+ 				config upgrade].
+ 		]].
+ 	^ config
+ !



More information about the Squeak-dev mailing list