[squeak-dev] The Trunk: MonticelloConfigurations-cmm.86.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Mar 15 19:15:20 UTC 2011

Chris Muller uploaded a new version of MonticelloConfigurations to project The Trunk:

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

Name: MonticelloConfigurations-cmm.86
Author: cmm
Time: 5 March 2011, 4:45:48.892 pm
UUID: ce837d5a-a13d-433b-aca0-b2620dd1e933
Ancestors: MonticelloConfigurations-cmm.85

- More conversions of version-name string-copying to use of new MCVersionName.
- Save one extra hit on #allFileNames per repository when updating Squeak!

=============== Diff against MonticelloConfigurations-cmm.85 ===============

Item was changed:
  ----- Method: MCConfiguration>>updateFromRepositories (in category 'updating') -----
  	| oldNames newNames sortedNames newDeps |
+ 	oldNames := self dependencies collect: [:dep | dep versionInfo versionName].
- 	oldNames := self dependencies collect: [:dep | dep versionInfo name].
  	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].
- 		[:a :b | a numericSuffix > b numericSuffix].
  	newDeps := OrderedCollection new.
  	self dependencies do: [:dep |
  		| newName |
  		newName := sortedNames
+ 			detect: [:each | each packageName = dep package name]
- 			detect: [:each | (each copyUpToLast: $-) = 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 changed:
  ----- Method: MCConfiguration>>versionNamed:for:from: (in category 'private') -----
+ versionNamed: aMCVersionName for: aDependency from: repo
- versionNamed: verName for: aDependency from: repo
  	| baseName fileName ver |
+ 	(repo filterFileNames: repo cachedFileNames forVersionNamed: aMCVersionName) ifNotEmptyDo: [:cachedNames |
- 	(repo filterFileNames: repo cachedFileNames forVersionNamed: verName) ifNotEmptyDo: [:cachedNames |
  		fileName := cachedNames anyOne.
  		self class extraProgressInfo
  			ifTrue:[ProgressNotification signal: '' extra: 'Using cached ', fileName].
  		ver := repo versionFromFileNamed: fileName].
  	ver ifNil: [
  		baseName := self diffBaseFor: aDependency.
+ 		(baseName notNil and: [baseName ~= aMCVersionName and: [repo includesVersionNamed: baseName]]) ifTrue: [
+ 			fileName := (MCDiffyVersion nameForVer: aMCVersionName base: baseName), '.mcd'.
- 		(baseName notNil and: [baseName ~= verName and: [repo includesVersionNamed: baseName]]) ifTrue: [
- 			fileName := (MCDiffyVersion nameForVer: verName base: baseName), '.mcd'.
  			self class extraProgressInfo
  				ifTrue:[ProgressNotification signal: '' extra: 'Downloading ', fileName].
  			ver := repo versionFromFileNamed: fileName]].
  	ver ifNil: [
+ 		fileName := aMCVersionName, '.mcz'.
- 		fileName := verName, '.mcz'.
  		self class extraProgressInfo
  			ifTrue:[ProgressNotification signal: '' extra: 'Downloading ', fileName].
  		ver := repo versionFromFileNamed: fileName].

Item was changed:
  ----- Method: MCMcmUpdater class>>updateFromRepositories: (in category 'updating') -----
  updateFromRepositories: repositoryUrls
  	"MCMcmUpdater updateFromRepositories: #(
  	| repos config |
  	Preferences enable: #upgradeIsMerge.
  	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.
  	"The list of updates-author.version.mcm sorted by version"
  	repos do:[:r| r cacheAllFileNamesDuring:[
  		| minVersion updateList allNames |
  		updateList := SortedCollection new.
  		minVersion := LastUpdateMap at: r description ifAbsent:[0].
  		"Find all the updates-author.version.mcm files"
  		'Checking ', r description
  			displayProgressAt: Sensor cursorPoint
  			from: 0 to: 1 during:[:bar| 
  				bar value: 0.
+ 				allNames := r allFileNamesOrCache.
- 				allNames := r allFileNames.
  		allNames do:[:versionedName| | version base parts author type |
  			parts := versionedName findTokens: '.-'.
  			parts size = 4 ifTrue:[
  				base := parts at: 1.
  				author := parts at: 2.
  				version := [(parts at: 3) asNumber] on: Error do:[:ex| ex return: 0].
  				type := parts at: 4.
  			(base = 'update' and:[version >= minVersion and:[type = 'mcm']]) 
  				ifTrue:[updateList add: version -> versionedName]].
  		"Proceed only if there are updates available at all."
  		updateList ifNotEmpty: [
  			"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 versionFromFileNamed: 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."
  			config updateFromRepositories.
  			config upgrade.

More information about the Squeak-dev mailing list