[Pkg] The Trunk: System-fbs.571.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 18 18:14:38 UTC 2013


Frank Shearar uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.571.mcz

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

Name: System-fbs.571
Author: fbs
Time: 18 July 2013, 5:34:48.204 pm
UUID: 305a4827-6784-f847-9d42-73e9c6dbd503
Ancestors: System-fbs.570

.... and move FileDirectory class>>openSources:forImage: to System-Files.

=============== Diff against System-fbs.570 ===============

Item was added:
+ ----- Method: FileDirectory class>>openSources:forImage: (in category '*System-Files') -----
+ openSources: fullSourcesName forImage: imageName 
+ "We first do a check to see if a compressed version ofthe sources file is present.
+ Open the .sources file read-only after searching in:
+ a) the directory where the VM lives
+ b) the directory where the image came from
+ c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).
+ "
+ 
+ 	| sources fd sourcesName |
+ 	(fullSourcesName endsWith: 'sources') ifTrue:
+ 		["Look first for a sources file in compressed format."
+ 		sources := self openSources: (fullSourcesName allButLast: 7) , 'stc'
+ 						forImage: imageName.
+ 		sources ifNotNil: [^ CompressedSourceStream on: sources]].
+ 
+ 	sourcesName := FileDirectory localNameFor: fullSourcesName.
+ 	"look for the sources file or an alias to it in the VM's directory"
+ 	fd := FileDirectory on: SmalltalkImage current vmPath.
+ 	(fd fileExists: sourcesName)
+ 		ifTrue: [sources := fd readOnlyFileNamed: sourcesName].
+ 	sources ifNotNil: [^ sources].
+ 	"look for the sources file or an alias to it in the image directory"
+ 	fd := FileDirectory on: (FileDirectory dirPathFor: imageName).
+ 	(fd fileExists: sourcesName)
+ 		ifTrue: [sources := fd readOnlyFileNamed: sourcesName].
+ 	sources ifNotNil: [^ sources].
+ 	"look for the sources in the current directory"
+ 	fd := DefaultDirectory.
+ 	(fd fileExists: sourcesName)
+ 		ifTrue: [sources := fd readOnlyFileNamed: sourcesName].
+ 	"sources may still be nil here"
+ 	^sources
+ !



More information about the Packages mailing list