[Pkg] The Trunk: SMBase-ul.129.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Jun 18 08:56:26 UTC 2011
Levente Uzonyi uploaded a new version of SMBase to project The Trunk:
http://source.squeak.org/trunk/SMBase-ul.129.mcz
==================== Summary ====================
Name: SMBase-ul.129
Author: ul
Time: 17 June 2011, 4:43:08.074 pm
UUID: 7068c92a-f96a-2946-bc1a-1f271fdf9cf9
Ancestors: SMBase-cmm.128
- Use #displayProgressFrom:to:during: instead of #displayProgressAt:from:to:during:.
=============== Diff against SMBase-cmm.128 ===============
Item was changed:
----- Method: SMSimpleInstaller>>unpack (in category 'services') -----
unpack
"This basic installer simply checks the file extension of
the downloaded file to choose suitable method for unpacking.
Currently it only supports .gz decompression.
If a file exists with the same name it is first deleted.
The unpacked filename is set on succesfull decompression or
if the file was not recognized as a compressed file."
| unzipped zipped buffer |
(fileName endsWith: '.gz')
ifTrue:[
unpackedFileName := fileName copyUpToLast: FileDirectory extensionDelimiter.
(dir fileExists: unpackedFileName) ifTrue:[ dir deleteFileNamed: unpackedFileName ].
unzipped := dir newFileNamed: unpackedFileName.
unzipped binary.
zipped := GZipReadStream on: ((dir readOnlyFileNamed: fileName) binary; yourself).
buffer := ByteArray new: 50000.
'Extracting ' , fileName
+ displayProgressFrom: 0
- displayProgressAt: Sensor cursorPoint
- from: 0
to: zipped sourceStream size
during: [:bar |
[zipped atEnd]
whileFalse:
[bar value: zipped sourceStream position.
unzipped nextPutAll: (zipped nextInto: buffer)].
zipped close.
unzipped close]]
ifFalse:[unpackedFileName := fileName]!
More information about the Packages
mailing list