[Pkg] The Trunk: MonticelloConfigurations-cmm.84.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 15 19:14:56 UTC 2011
Chris Muller uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-cmm.84.mcz
==================== Summary ====================
Name: MonticelloConfigurations-cmm.84
Author: cmm
Time: 3 March 2011, 1:55:20.972 pm
UUID: 317ec71a-c8f7-4647-8499-5aa1fbbb8650
Ancestors: MonticelloConfigurations-cbc.83
- Eliminate unnecessary external usage of unscalable MC api's (#allVersionNames).
- #possiblyNewerVersionsOfAnyOf: no longer requires VersionInfo objects, just the version names.
=============== Diff against MonticelloConfigurations-cbc.83 ===============
Item was changed:
----- Method: MCConfiguration>>depsSatisfying:versionDo:displayingProgress: (in category 'private') -----
+ depsSatisfying: selectBlock versionDo: verBlock displayingProgress: progressString
+ | count action |
- depsSatisfying: selectBlock versionDo: verBlock displayingProgress: progressString
- | repoMap count action |
- repoMap := Dictionary new.
- self repositories do: [:repo |
- MCRepositoryGroup default addRepository: repo.
- repo allVersionNames
- ifEmpty: [self logWarning: 'cannot read from ', repo description]
- ifNotEmptyDo: [:all | all do: [:ver | repoMap at: ver put: repo]]].
-
count := 0.
+ self repositories do: [ : eachRepository | MCRepositoryGroup default addRepository: eachRepository ].
+ action := [ : dep | | ver repo |
+ ver := dep versionInfo name.
+ repo := self repositories
+ detect:
+ [ : eachRepository | eachRepository includesVersionNamed: ver ]
+ ifFound:
+ [ : foundRep | foundRep ]
+ ifNone:
+ [ self logError: 'Version ' , ver , ' not found in any repository'.
- action := [:dep |
- | ver repo |
- ver := dep versionInfo name.
- repo := repoMap at: ver ifAbsent: [
- self logError: 'Version ', ver, ' not found in any repository'.
self logError: 'Aborting'.
+ ^ count ].
+ (selectBlock value: dep) ifTrue:
+ [ | new |
+ new := self
+ versionNamed: ver
+ for: dep
+ from: repo.
+ new
+ ifNil:
+ [ self logError: 'Could not download version ' , ver , ' from ' , repo description.
+ self logError: 'Aborting'.
+ ^ count ]
+ ifNotNil:
+ [ self
+ logUpdate: dep package
+ with: new.
+ self class extraProgressInfo ifTrue:
+ [ ProgressNotification
+ signal: ''
+ extra: 'Installing ' , ver ].
+ verBlock value: new.
+ count := count + 1 ] ].
+ dep package workingCopy repositoryGroup addRepository: repo ].
+ self class extraProgressInfo
+ ifTrue:
+ [ self dependencies
+ do: action
+ displayingProgress: progressString ]
+ ifFalse: [ self dependencies do: action ].
+ ^ count!
- ^count].
- (selectBlock value: dep) ifTrue: [
- | new |
- new := self versionNamed: ver for: dep from: repo.
- new ifNil: [
- self logError: 'Could not download version ', ver, ' from ', repo description.
- self logError: 'Aborting'.
- ^count]
- ifNotNil: [
- self logUpdate: dep package with: new.
- self class extraProgressInfo
- ifTrue:[ProgressNotification signal: '' extra: 'Installing ', ver].
- verBlock value: new.
- count := count + 1.
- ]
- ].
- dep package workingCopy repositoryGroup addRepository: repo.
- ].
- self class extraProgressInfo
- ifTrue:[self dependencies do: action displayingProgress: progressString]
- ifFalse:[self dependencies do: action].
- ^count!
Item was changed:
----- Method: MCConfiguration>>updateFromRepositories (in category 'updating') -----
updateFromRepositories
+ | oldNames newNames sortedNames newDeps |
+ oldNames := self dependencies collect: [:dep | dep versionInfo name].
- | oldInfos newNames sortedNames newDeps |
- oldInfos := self dependencies collect: [:dep | dep versionInfo].
newNames := Dictionary new.
self repositories
do: [:repo |
ProgressNotification signal: '' extra: 'Checking ', repo description.
+ (repo possiblyNewerVersionsOfAnyOf: oldNames)
- (repo possiblyNewerVersionsOfAnyOf: oldInfos)
do: [:newName | newNames at: newName put: repo]]
displayingProgress: 'Searching new versions'.
sortedNames := newNames keys asArray sort:
[:a :b | a numericSuffix > b numericSuffix].
newDeps := OrderedCollection new.
self dependencies do: [:dep |
| newName |
newName := sortedNames
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: MCConfigurationBrowser>>checkMissing (in category 'dependencies') -----
checkMissing
| missing |
+ missing := (self dependencies collect:
+ [ : ea | ea versionInfo name ]) asSet.
+ self repositories do:
+ [ : eachRepository | eachRepository cacheAllFileNamesDuring:
+ [ missing copy do:
+ [ : eachVersionName | (eachRepository includesVersionNamed: eachVersionName) ifTrue: [ missing remove: eachVersionName ] ] ] ].
+ ^ missing isEmpty or:
+ [ self selectDependency: missing anyOne.
+ self confirm:
+ (String streamContents:
+ [ : strm | strm
+ nextPutAll: 'No repository found for' ;
+ cr.
+ missing do:
+ [ : r | strm
+ nextPutAll: r ;
+ cr ].
+ strm nextPutAll: 'Do you still want to store?' ]) ]!
- missing := (self dependencies collect: [:ea | ea versionInfo name]) asSet.
-
- self repositories
- do: [:repo |
- repo allVersionNames
- do: [:found | missing remove: found ifAbsent: []]]
- displayingProgress: 'searching versions'.
-
- ^missing isEmpty or: [
- self selectDependency: missing anyOne.
- self confirm: (String streamContents: [:strm |
- strm nextPutAll: 'No repository found for'; cr.
- missing do: [:r | strm nextPutAll: r; cr].
- strm nextPutAll: 'Do you still want to store?'])]
- !
More information about the Packages
mailing list