[Pkg] The Trunk: System-dtl.232.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jan 15 01:23:48 UTC 2010


David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.232.mcz

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

Name: System-dtl.232
Author: dtl
Time: 14 January 2010, 8:18:33.642 pm
UUID: 33164491-ea37-4549-b5c4-781003a120d0
Ancestors: System-ul.231

Change Set:		compressSources-bf
Date:			14 January 2010
Author:			Bert Freudenberg

Fix compressing sources to preserve utf8 encoding. Fix reading chunks to decode utf8.
TODO: figure out if anything else than chunk reading is used. decode utf8 there, too.

=============== Diff against System-ul.231 ===============

Item was changed:
  ----- Method: SystemDictionary>>compressSources (in category 'housekeeping') -----
  compressSources	
  	"Copy all the source file to a compressed file. Usually preceded by Smalltalk condenseSources."
  	"The new file will be created in the default directory, and the code in openSources
  	will try to open it if it is there, otherwise it will look for normal sources."
  	"Smalltalk compressSources"
  
  	| f cfName cf |
+ 	f := SourceFiles first readOnlyCopy binary.	"binary to preserve utf8 encoding"
+ 	(f localName endsWith: 'sources')
+ 		ifTrue: [cfName := (f localName allButLast: 7) , 'stc']
- 	f := SourceFiles first.
- 	(SmalltalkImage current sourcesName endsWith: 'sources')
- 		ifTrue: [cfName := (SmalltalkImage current sourcesName allButLast: 7) , 'stc']
  		ifFalse: [self error: 'Hey, I thought the sources name ended with ''.sources''.'].
  	cf := (CompressedSourceStream on: (FileStream newFileNamed: cfName))
+ 				segmentSize: 65536 maxSize: f size.
- 				segmentSize: 20000 maxSize: f size.
  
  	"Copy the sources"
  'Compressing Sources File...'
  	displayProgressAt: Sensor cursorPoint
  	from: 0 to: f size
  	during:
  		[:bar | f position: 0.
  		[f atEnd] whileFalse:
+ 			[cf nextPutAll: (f next: 65536).
- 			[cf nextPutAll: (f next: 20000).
  			bar value: f position]].
  	cf close.
  	self setMacFileInfoOn: cfName.
  	self inform: 'You now have a compressed sources file!!
  Squeak will use it the next time you start.'!



More information about the Packages mailing list