[Pkg] The Trunk: MonticelloConfigurations-ul.94.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 8 19:21:22 UTC 2011


Levente Uzonyi uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-ul.94.mcz

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

Name: MonticelloConfigurations-ul.94
Author: ul
Time: 8 May 2011, 8:00:55.083 pm
UUID: 94f752df-3e92-304b-a0ae-1751c3532b58
Ancestors: MonticelloConfigurations-cmm.93

- enh: cache all filenames for all repositories during MCConfiguration>>updateFromRepositories
- minor refactoring of the update code

=============== Diff against MonticelloConfigurations-cmm.93 ===============

Item was changed:
  ----- Method: MCConfiguration>>updateFromRepositories (in category 'updating') -----
  updateFromRepositories
- 	| oldNames newNames sortedNames newDeps |
- 	oldNames := self dependencies collect: [:dep | dep versionInfo versionName].
- 	newNames := Dictionary new.
- 	self repositories
- 		do: [:repo | 
- 			ProgressNotification signal: '' extra: 'Checking ', repo description.
- 			(repo possiblyNewerVersionsOfAnyOf: oldNames)
- 				do: [:newName | newNames at: newName put: repo]]
- 		displayingProgress: 'Searching new versions'.
  
+ 	(repositories
+ 		inject: [ self updateFromRepositoriesWithoutCaching ]
+ 		into: [ :innerBlock :repository |
+ 			[ repository cacheAllFileNamesDuring: innerBlock ] ]) value
+ 	
- 	sortedNames := newNames keys asArray sort:
- 		[:a :b | a versionNumber > b versionNumber].
- 
- 	newDeps := OrderedCollection new.
- 	self dependencies do: [:dep |
- 		| newName |
- 		newName := sortedNames
- 			detect: [:each | each packageName = dep package name]
- 			ifNone: [nil].
- 		newDeps add: (newName
- 			ifNil: [dep]
- 			ifNotNil: [
- 				| repo info  |
- 				repo := newNames at: newName.
- 				info := self versionInfoNamed: newName for: dep from: repo.
- 				info ifNil: [dep]
- 					ifNotNil: [MCVersionDependency package: dep package info: info]
- 			])
- 	] displayingProgress: 'downloading new versions'.
- 
- 	self dependencies: newDeps.
  !

Item was added:
+ ----- Method: MCConfiguration>>updateFromRepositoriesWithoutCaching (in category 'updating') -----
+ updateFromRepositoriesWithoutCaching
+ 
+ 	| oldNames newNames sortedNames newDeps |
+ 	oldNames := self dependencies collect: [:dep | dep versionInfo versionName].
+ 	newNames := Dictionary new.
+ 	self repositories
+ 		do: [:repo | 
+ 			ProgressNotification signal: '' extra: 'Checking ', repo description.
+ 			(repo possiblyNewerVersionsOfAnyOf: oldNames)
+ 				do: [:newName | newNames at: newName put: repo]]
+ 		displayingProgress: 'Searching new versions'.
+ 
+ 	sortedNames := newNames keys asArray sort:
+ 		[:a :b | a versionNumber > b versionNumber].
+ 
+ 	newDeps := OrderedCollection new: self dependencies size.
+ 	self dependencies
+ 		do: [:dep |
+ 			newDeps add: (sortedNames
+ 				detect: [:each | each packageName = dep package name]
+ 				ifFound: [ :newName |
+ 					| repo |
+ 					repo := newNames at: newName.
+ 					(self versionInfoNamed: newName for: dep from: repo)
+ 						ifNil: [ dep ]
+ 						ifNotNil: [ :info |
+ 							MCVersionDependency package: dep package info: info ] ]
+ 				ifNone: [ dep ]) ]
+ 		displayingProgress: 'downloading new versions'.
+ 
+ 	self dependencies: newDeps.
+ !



More information about the Packages mailing list