[Pkg] The Trunk: Monticello-cmm.536.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Apr 22 18:37:11 UTC 2013
Frank Shearar uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-cmm.536.mcz
==================== Summary ====================
Name: Monticello-cmm.536
Author: cmm
Time: 15 April 2013, 10:31:15.368 am
UUID: 1f3af037-b0fd-436a-ad84-328010a019a5
Ancestors: Monticello-bf.535
- API contract for #versionNamed: stipulates it will return nil if no version for the given name is found, not signal a FileDoesNotExistException.
- Allow MCRepositoryGroup to act as a MCRepository for Installer's purposes.
=============== Diff against Monticello-bf.535 ===============
Item was changed:
----- Method: MCFileBasedRepository>>versionNamed: (in category 'versions') -----
+ versionNamed: aMCVersionName
- versionNamed: aMCVersionName
"For FileBased repositories, aMCVersionName must have the appropriate extension!! :-("
+ | version |
+ version := self cache
+ at: aMCVersionName
+ ifAbsent:
+ [ [ self loadVersionFromFileNamed: aMCVersionName ]
+ on: FileDoesNotExistException
+ do: [ : err | nil ] ].
- | v |
- v := self cache at: aMCVersionName ifAbsent: [self loadVersionFromFileNamed: aMCVersionName].
self resizeCache: cache.
+ (version notNil and: [ version isCacheable ]) ifTrue:
+ [ cache
+ at: aMCVersionName asMCVersionName
+ put: version ].
+ ^ version!
- (v notNil and: [v isCacheable]) ifTrue: [cache at: aMCVersionName asMCVersionName put: v].
- ^ v!
Item was added:
+ ----- Method: MCRepository>>normalized (in category 'accessing') -----
+ normalized
+ ^ (MCRepositoryGroup default repositories includes: self)
+ ifTrue: [ self ]
+ ifFalse: [ self copy ]!
Item was added:
+ ----- Method: MCRepository>>normalizedRepositories (in category 'private') -----
+ normalizedRepositories
+ ^ Array with: self normalized!
Item was added:
+ ----- Method: MCRepository>>repositories (in category 'accessing') -----
+ repositories
+ ^ Array with: self!
Item was added:
+ ----- Method: MCRepositoryGroup>>allPackageNames (in category 'repository-api') -----
+ allPackageNames
+ ^ repositories
+ inject: Set new
+ into:
+ [ : set : each | set
+ addAll: each allPackageNames ;
+ yourself ]!
Item was added:
+ ----- Method: MCRepositoryGroup>>basicStoreVersion: (in category 'repository-api') -----
+ basicStoreVersion: aVersion
+ "RepositoryGroup is used for reading, not writing."
+ self shouldNotImplement!
Item was added:
+ ----- Method: MCRepositoryGroup>>description (in category 'repository-api') -----
+ description
+ ^ String streamContents:
+ [ : stream | stream nextPutAll: '{ '.
+ repositories
+ do: [ : each | stream nextPut: $'; nextPutAll: each description; nextPut: $' ]
+ separatedBy: [ stream nextPutAll: '. ' ].
+ stream nextPutAll: ' }' ]!
Item was changed:
+ ----- Method: MCRepositoryGroup>>includesVersionNamed: (in category 'repository-api') -----
- ----- Method: MCRepositoryGroup>>includesVersionNamed: (in category 'testing') -----
includesVersionNamed: aString
+ ^ repositories anySatisfy: [ : each | each includesVersionNamed: aString ]!
- | versionName |
- versionName := aString asMCVersionName.
- self repositoriesDo:
- [ : ea | (ea includesVersionNamed: versionName) ifTrue: [ ^ true ] ].
- ^ false!
Item was changed:
----- Method: MCRepositoryGroup>>initialize (in category 'initialize-release') -----
initialize
+ super initialize.
repositories := OrderedCollection new!
Item was changed:
+ ----- Method: MCRepositoryGroup>>morphicOpen: (in category 'ui') -----
- ----- Method: MCRepositoryGroup>>morphicOpen: (in category 'as yet unclassified') -----
morphicOpen: aWorkingCopy
^ self repositories do: [:repo | repo morphicOpen: aWorkingCopy].!
Item was added:
+ ----- Method: MCRepositoryGroup>>normalizedRepositories (in category 'accessing') -----
+ normalizedRepositories
+ "Find an existing instance of any active repository so that we use whatever name and password the user usually uses. If not found, answer a copy"
+ ^ repositories collect: [ : each | each normalized ]!
Item was changed:
+ ----- Method: MCRepositoryGroup>>versionNamed: (in category 'repository-api') -----
+ versionNamed: aMCVersionName
+ repositories do:
+ [ : each | (each versionNamed: aMCVersionName) ifNotNil: [ : ver | ^ ver ] ].
+ ^ nil!
- ----- Method: MCRepositoryGroup>>versionNamed: (in category 'versions') -----
- versionNamed: aString
- self repositories do: [:repo | | version |
- version := [repo versionNamed: aString] on: Error do: [nil].
- version ifNotNil: [:v | ^ v]].
- self error: 'No repositories contain version ', aString.!
Item was changed:
+ ----- Method: MCRepositoryGroup>>versionNamesForPackageNamed: (in category 'repository-api') -----
+ versionNamesForPackageNamed: aString
+ ^ repositories
+ inject: Set new
+ into:
+ [ : set : each | set
+ addAll: (each versionNamesForPackageNamed: aString) ;
+ yourself ]!
- ----- Method: MCRepositoryGroup>>versionNamesForPackageNamed: (in category 'versions') -----
- versionNamesForPackageNamed: aString
- ^ self repositories gather: [:repo |
- [repo versionNamesForPackageNamed: aString] on: Error do: [#()]]!
Item was added:
+ ----- Method: MCRepositoryGroup>>versionWithInfo:ifAbsent: (in category 'repository-api') -----
+ versionWithInfo: aVersionInfo ifAbsent: aBlock
+ repositories do:
+ [ : each | (each
+ versionWithInfo: aVersionInfo
+ ifAbsent: [ ]) ifNotNil:
+ [ : ver | ^ ver ] ].
+ ^ aBlock value!
More information about the Packages
mailing list