Trying to build .sar experience

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Mon Sep 27 09:40:06 UTC 2004


I wish to share this.
This week end , I try to send a thanks in morph form to one of Squeakers
what inspire me 
In the process of doing, I "discover" the following.
SarBuilder is not part of 3.7 , I have to load from SqueakMap besides
complaint off not safe for it.
SarBuilder  not seems designed for having other files as code ones, so I
ending adding class method and founded several problems.
How I could select files for including ?
A easy and to hand solutions could come of steal code of FIND button in find
any file.
Guess what. I found something what could be a bug in OSX (Test the same in
virgin image both in OSX and OS 9 in other mac, send mail about this to list
and cure the behavior in my OSX machine)
Add also a missing CODE button in dialog window.
Reading code I found companionFiles (but no senders)
companionFiles: anObject

and 

additionalFiles
    ^companionFiles

Finally , I decided for asking to user prefix of files and doing file :=
FileList2 modalFileSelectorForSuffixes: aList].
In building the sar, I found two more troubles what I think fix.
One is when I don¹t wish having additional sources

fileOutAdditionalSources
"Modified for not having additionalChangeSets causes error"
    self additionalChangeSets ifNotNilDo: [:cs | self fileOutCompanionSet:
cs]
The other is .zip building take path of files , I think the right could be
local names

fileOutAdditionalFile: aPath
" This modification is for aditional file not in local directory"
    zip addMember: ((ZipArchiveMember newFromFile: aPath)
                fileName: (FileDirectory localNameFor: aPath);
                desiredCompressionMethod: ZipArchive compressionDeflated;
                yourself).
    preamble
        nextPutAll: 'self extractMember: ''';
        nextPutAll: (FileDirectory localNameFor: aPath);
        nextPutAll: '''.';
        cr

SARChangeSetDumper class methodsFor: 'instance creation' stamp: 'edc
9/25/2004 18:36'!
withAdititionalFiles
"This add lets you more easy construction of packages what contains
aditional files likes pictures or other no code stuff"
| lisrOfFiles file aList |
    lisrOfFiles := OrderedCollection new.
    
    [aList := FillInTheBlankMorph request: 'Complete suffix list'.
    aList isEmptyOrNil ifFalse:[
    aList := aList findTokens:' ' .
    file := FileList2 modalFileSelectorForSuffixes: aList].
    (file notNil) & ( aList isEmptyOrNil not) ] whileTrue:[ lisrOfFiles add:
file name].

^(self new) initialize;
        changeSet: ChangeSet current;
        companionFiles: lisrOfFiles;
        fileOutAsZipNamed: ChangeSet current name , '.sar'

So , I expect someone could use this, and if someone wish to exchange
"MorphicGreetings" , I send he one auto runnig sar.

Edgar







More information about the Squeak-dev mailing list