[squeak-dev] Metacello load error 'File is too short' in Squeak6.0alpha latest update: #17402 ?
H. Hirzel
hannes.hirzel at gmail.com
Thu Sep 28 10:05:03 UTC 2017
Thank you, Tobias, for the explanation
--------------------------------------------------------
Found that the file
MultiByteFileStream:
'/home/user20/Documents/Squeak6.0alpha-17382-64bit-All-in-One.app/Contents/Resources/package-cache/Metacello-MC-dkh.680.mcz'
just had 0 bytes length. I deleted it and restarted [3]. Then the load
process [4] as given in https://github.com/Metacello/metacello went
fine.
--Hannes
----------------------------------------------------
[3]
"Bootstrap Metacello Preview, using mcz files (#'previewBootstrap'
symbolic version"
((Smalltalk at: #ConfigurationOfMetacello) project
version: #'previewBootstrap') load.
------------------------------------------------------------------------------------------
[4] Installation instructions for Metacello (
http://wiki.squeak.org/squeak/6157 )
https://github.com/Metacello/metacello
"Get the Metacello configuration (for Squeak users)"
Installer gemsource
project: 'metacello';
addPackage: 'ConfigurationOfMetacello';
install.
"Bootstrap Metacello Preview, using mcz files (#'previewBootstrap'
symbolic version"
((Smalltalk at: #ConfigurationOfMetacello) project
version: #'previewBootstrap') load.
"Load the Preview version of Metacello from GitHub"
(Smalltalk at: #Metacello) new
configuration: 'MetacelloPreview';
version: #stable;
repository: 'github://dalehenrich/metacello-work:configuration';
load.
"Now load latest version of Metacello"
(Smalltalk at: #Metacello) new
baseline: 'Metacello';
repository: 'github://dalehenrich/metacello-work:master/repository';
get.
(Smalltalk at: #Metacello) new
baseline: 'Metacello';
repository: 'github://dalehenrich/metacello-work:master/repository';
load.
On 9/28/17, Tobias Pape <Das.Linux at gmx.de> wrote:
> Hi Hannes
>
>> On 28.09.2017, at 11:45, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>
>> Hello
>>
>> Following the Metacello installation instructions [1] the following
>> step A runs fine but the step B afterwards gives an error message
>> 'File too short' [2], marked with '"ERROR FILE TOO SHORT'
>>
>> "A: Get the Metacello configuration (for Squeak users)"
>> Installer gemsource
>> project: 'metacello';
>> addPackage: 'ConfigurationOfMetacello';
>> install.
>>
>>
>> "B: Bootstrap Metacello Preview, using mcz files (#'previewBootstrap'
>> symbolic version"
>> ((Smalltalk at: #ConfigurationOfMetacello) project
>> version: #'previewBootstrap') load.
>>
>>
>> Any suggestion how to fix this?
>
>
> Please make sure to clean your package cache, maybe an mcz got corrupted
> earlier during download.
> (I just recently fixed some things in the workflow)
>
> For reference, When I execute the snippet, My transcript output is as
> follows:
>
> ================================================================================================================================================
> found ConfigurationOfMetacello-topa.803.mcz...
>
> ConfigurationOfMetacello class>>unloadMetacello (Gofer is Undeclared) loaded
>
> Loading 1.0-beta.31.1.8 of ConfigurationOfMetacello...
> Fetched -> ConfigurationOfGofer-dkh.45 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://seaside.gemtalksystems.com/ss/metacello
> Loaded -> ConfigurationOfGofer-dkh.45 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://seaside.gemtalksystems.com/ss/metacello
> Project: Gofer Core 1.0.5.1
> Fetched -> Gofer-Core.squeak-dkh.135 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-Core-dkh.494 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-Platform.squeak-dkh.17 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://smalltalkhub.com/mc/dkh/metacello/main
> Loaded -> Gofer-Core.squeak-dkh.135 ---
> http://seaside.gemtalksystems.com/ss/metacello --- cache
> Loaded -> Metacello-Core-dkh.494 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> MetacelloSqueakPlatform>>downloadFile:to: (OSProcess is Undeclared)
> MetacelloSqueakPlatform>>downloadFile:to: (OSProcess is Undeclared)
> MetacelloSqueakPlatform>>extractRepositoryFrom:to: (OSProcess is Undeclared)
> Loaded -> Metacello-Platform.squeak-dkh.17 ---
> http://seaside.gemtalksystems.com/ss/metacello --- cache
> ...finished 1.0-beta.31.1.8
> Loading 1.0-beta.32.3 of ConfigurationOfMetacello...
> Fetched -> ConfigurationOfFileTree-dkh.67 ---
> http://ss3.gemtalksystems.com/ss/FileTree ---
> http://ss3.gemtalksystems.com/ss/FileTree
> Loaded -> ConfigurationOfFileTree-dkh.67 ---
> http://ss3.gemtalksystems.com/ss/FileTree ---
> /Users/tobias/dev/Squeak-Trunk/package-cache
> Project: FileTree stable
> Fetched -> MonticelloFileTree-Core.squeak43-dkh.169 ---
> http://ss3.gemtalksystems.com/ss/FileTree ---
> http://ss3.gemtalksystems.com/ss/FileTree
> Fetched -> MonticelloFileTree-FileDirectory-Utilities.squeak43-dkh.12 ---
> http://ss3.gemtalksystems.com/ss/FileTree ---
> http://ss3.gemtalksystems.com/ss/FileTree
> Project: Gofer stable
> Fetched -> Metacello-Base-dkh.109 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-Core-dkh.695 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://smalltalkhub.com/mc/dkh/metacello/main
> Fetched -> Metacello-MC-dkh.680 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-Platform.squeak-tfel.25 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-ToolBox-dkh.134 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> Fetched -> Metacello-FileTree-dkh.29 ---
> http://seaside.gemtalksystems.com/ss/metacello ---
> http://smalltalkhub.com/mc/dkh/metacello/main
> Fetched -> Metacello-GitHub-dkh.29 ---
> http://smalltalkhub.com/mc/dkh/metacello/main ---
> http://seaside.gemtalksystems.com/ss/metacello
> MCFileTreeStCypressWriter class>>fileNameForSelector:(specials is shadowed)
> Loaded -> MonticelloFileTree-Core.squeak43-dkh.169 ---
> http://ss3.gemtalksystems.com/ss/FileTree --- cache
> Loaded -> MonticelloFileTree-FileDirectory-Utilities.squeak43-dkh.12 ---
> http://ss3.gemtalksystems.com/ss/FileTree --- cache
> BaselineOf>>projectClass (MetacelloMCBaselineProject is Undeclared)
> ConfigurationOf>>versionNumberClass (MetacelloSemanticVersionNumber is
> Undeclared)
> Loaded -> Metacello-Base-dkh.109 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> MetacelloProjectRegistration>>version (MetacelloMCBaselineProject is
> Undeclared)
> MetacelloBaselineSpecGenerator>>projectSpecCreationBlock
> (MetacelloMCBaselineProject is Undeclared)
> Loaded -> Metacello-Core-dkh.695 ---
> http://seaside.gemtalksystems.com/ss/metacello --- cache
> Loaded -> Metacello-MC-dkh.680 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> Loaded -> Metacello-Platform.squeak-tfel.25 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> Loaded -> Metacello-ToolBox-dkh.134 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> Loaded -> Metacello-FileTree-dkh.29 ---
> http://seaside.gemtalksystems.com/ss/metacello --- cache
> Loaded -> Metacello-GitHub-dkh.29 ---
> http://smalltalkhub.com/mc/dkh/metacello/main --- cache
> Evaluated -> 1.0-beta.32.3 [ConfigurationOfMetacello] >>
> metacelloPrimeRegistry
> ...finished 1.0-beta.32.3
> ================================================================================================================================================
>
> Hope that helps.
>
> Best regards
> -Tobias
>
> PS: Metacello is now at https://github.com/Metacello/metacello but the
> bootstrap should work nonetheless.
>
>
>
>>
>> Kind regards
>> Hannes
>>
>>
>> [1] https://github.com/dalehenrich/metacello-work
>>
>> [2] ZipArchive class findEndOfCentralDirectoryFrom: stream
>> "Seek in the given stream to the end, then read backwards until we find
>> the
>> signature of the central directory record. Leave the file positioned
>> right
>> before the signature.
>>
>> Answers the file position of the EOCD, or 0 if not found."
>>
>> | data fileLength seekOffset pos maxOffset |
>> stream setToEnd.
>> fileLength := stream position.
>> "If the file length is less than 18 for the EOCD length plus 4 for
>> the signature, we have a problem"
>> fileLength < 22 ifTrue: [^ self error: 'file is too short'].
>> "ERROR FILE TOO SHORT"
>>
>> seekOffset := 0.
>> pos := 0.
>> data := ByteArray new: 4100.
>> maxOffset := 40960 min: fileLength. "limit search range to 40K"
>>
>> [
>> seekOffset := (seekOffset + 4096) min: fileLength.
>> stream position: fileLength - seekOffset.
>> data := stream next: (4100 min: seekOffset) into: data startingAt: 1.
>> pos := self lastIndexOfPKSignature: EndOfCentralDirectorySignature in:
>> data.
>> pos = 0 and: [seekOffset < maxOffset]
>> ] whileTrue.
>>
>> ^ pos > 0
>> ifTrue: [ | newPos | stream position: (newPos := (stream position +
>> pos - seekOffset - 1)). newPos]
>> ifFalse: [0]
>>
>
>
>
More information about the Squeak-dev
mailing list
|