SAR and MC

Ned Konz ned at squeakland.org
Sun Feb 22 21:05:52 UTC 2004


On Sunday 22 February 2004 9:42 am, ducasse wrote:

> I would like to migrate all my code in MC. But I used to ship the code
> as a sar package because like that I can say click only on that and
> load it.
>
> - Question 0: is there an easy way to convert a CS into a MC packages?
> I'm asking for trivial cases where
> there is only one class in one category but a lot of class
> extensions....

Yes. I need to update the PackageInfo-Extras work that Avi did with my latest 
stuff, so that you can just choose a change set in the change sorter and 
choose "add all to package..." and it will rename the method extension 
categories for you.

> - Question 1: Is there a simple way to do create a sar once I have
> everything in MC?

Yes. I will be updating my SARBuilder package soon. Until then...

I posted an example of manual creation for Tim a few days ago:

As far as building a SAR, it's not too hard if you have files:

zip _ ZipArchive new.
(zip addFile: 'package-cache/BFAV-nk.122.mcz' as: 'BFAV.mcz') 
desiredCompressionLevel: 0.
zip addString: 'self fileInMonticelloZipVersionNamed: ''BFAV.mcz''.' as: 
'install/preamble'.
zip writeToFileNamed: 'myNewSar.sar'


or you can just write a MCZ into the Zip directly:

zip _ ZipArchive new.
mczStream _ RWBinaryOrTextStream on: (String new: 10000).
workingCopy _ MCWorkingCopy forPackage: (MCPackage new name: 'BFAV').
version _ workingCopy newVersion.
version fileOutOn: mczStream.
(zip addString: mczStream contents as: 'BFAV.mcz') desiredCompressionLevel: 0.
zip addString: 'self fileInMonticelloZipVersionNamed: ''BFAV.mcz''.' as: 
'install/preamble'.
zip writeToFileNamed: 'myNewSar2.sar'

> - Question 1b: is is better/simpler to work from mcz file or changesets?

MCZ.

> - Question 1c:  if I put mcz files in sar, does it means that I can
> load them in a default image (without MC proloaded)
> I guess that this is right?

Yes. SARInstaller (at least the most recent version) will use the MCInstaller 
to load these.

> - Question 2: How do I specify in MC that some actions should happen
> once the package is loaded?

You can use the class startUp: method if you want. If you're making a SAR, 
though, the better way is to do this in the install/postscript.

> - Question 3:
> I read  that in another thread:
> 	You can install a .mcz file with the latest version of the
> SARInstaller (available on SqueakMap).
> this should only work for 3.7 is it correct because for this code I'm
> still in 3.6 waiting for 3.7 to be official?
>
> - Question 3b: If I use sar for deployment with MCZ files, does it keep
> the versions of the package so that if I identify a bug
> I can fix it directly. I guess not but I want to be sure.
> Or do I have to go via the MC repository and reload everything then fix
> it and republish it?
>
> - Question 4: Should I investigated that?
> As far as building a SAR, it's not too hard if you have files:
> zip _ ZipArchive new.
> (zip addFile: 'package-cache/BFAV-nk.122.mcz' as: 'BFAV.mcz')
> desiredCompressionLevel: 0.
> zip addString: 'self fileInMonticelloZipVersionNamed: ''BFAV.mcz''.' as:
> 'install/preamble'.
> zip writeToFileNamed: 'myNewSar.sar'
>
> or you can just write a MCZ into the Zip directly:
>
> zip _ ZipArchive new.
> mczStream _ RWBinaryOrTextStream on: (String new: 10000).
> workingCopy _ MCWorkingCopy forPackage: (MCPackage new name: 'BFAV').
> version _ workingCopy newVersion.
> version fileOutOn: mczStream.
> (zip addString: mczStream contents as: 'BFAV.mcz')
> desiredCompressionLevel: 0.
> zip addString: 'self fileInMonticelloZipVersionNamed: ''BFAV.mcz''.' as:
> 'install/preamble'.
> zip writeToFileNamed: 'myNewSar2.sar'
>
> Thanks.
>
> Stef

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list