[squeak-dev] The Inbox: Installer-Core-fbs.361.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 17 22:15:03 UTC 2013


Frank Shearar uploaded a new version of Installer-Core to project The Inbox:
http://source.squeak.org/inbox/Installer-Core-fbs.361.mcz

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

Name: Installer-Core-fbs.361
Author: fbs
Time: 17 January 2013, 10:14:55.106 pm
UUID: 6b44c4f2-631a-46e9-82a1-29df951936b9
Ancestors: Installer-Core-bp.360

#3 of 3 letting "Installer ss install: 'Foo'" use the local cache repository if possible.

If you run "Installer ss3 install: 'CoolWidget-xyz.1.mcz', load it from the cache repository if possible. Otherwise, use the canonical repository.

This lets you still use SqueakMap Installer scripts even when you're not connected to the Internet.

=============== Diff against Installer-Core-bp.360 ===============

Item was changed:
  ----- Method: InstallerMonticello>>mcThing (in category 'monticello') -----
  mcThing
+ 	| loader localCache |
- 	| loader |
  	loader := self classMCVersionLoader new.
+ 	localCache := self classMCCacheRepository default.
  	self logCR: 'reading ' , mc description , '...'.
  	"several attempts to read files - repository readableFileNames
  	sometimes fails"
  	self packages
  		do: [:pkg | 
  			| versionNames fileToLoad version |
+ 			versionNames := self versionNamesForPackageNamed: (self packageName: pkg) withCache: localCache.
- 			versionNames := mc versionNamesForPackageNamed:
- 				(pkg asMCVersionName versionNumber = 0 
- 					ifTrue: [ "Just a package name specified, use it whole." pkg ] 
- 					ifFalse: [pkg asMCVersionName packageName]).
  			versionNames sort: self mcSortFileBlock.
  			fileToLoad := versionNames
  						detect: (self mcDetectFileBlock: pkg)
  						ifNone: [ nil ].
  			fileToLoad
+ 				ifNotNil: [version := [localCache versionNamed: fileToLoad] on: MCError do: [mc versionNamed: fileToLoad].
- 				ifNotNil: [version := mc versionNamed: fileToLoad.
  					(version isKindOf: MCConfiguration)
  						ifTrue: [^ version]
  						ifFalse: [MCRepositoryGroup default addRepository: self normalizedRepository.
  							version workingCopy repositoryGroup addRepository: self normalizedRepository.
  							loader addVersion: version].
  					self logCR: ' found ' , version fileName , '...']].
  	^ loader!

Item was added:
+ ----- Method: InstallerMonticello>>packageName: (in category 'private') -----
+ packageName: versionString
+ 	"Extract the package name out of a Monticello version string: 'Foo', 'Foo-fbs.1', 'Foo-fbs.1.mcz'."
+ 	^ versionString asMCVersionName versionNumber = 0 
+ 					ifTrue: [ "Just a package name specified, use it whole." versionString ] 
+ 					ifFalse: [versionString asMCVersionName packageName]!

Item was added:
+ ----- Method: InstallerMonticello>>versionNamesForPackageNamed:withCache: (in category 'private') -----
+ versionNamesForPackageNamed: aString withCache: localCache
+ 	"The local cache might contain some versions of this package. The network might not be available. Try return a merged list of both, but otherwise just return the local versions."
+ 	| localVersions remoteVersions |
+ 	localVersions := localCache versionNamesForPackageNamed: aString.
+ 	remoteVersions := [mc versionNamesForPackageNamed: aString]
+ 		on: MCError do: [Array empty].
+ 	^ (localVersions asSet addAll: remoteVersions; yourself) asArray.!



More information about the Squeak-dev mailing list