hi -
Attached you'll find a much cleaner editor for loading/unloading scripts attached to PackageInfo *and* a fully functional loader/unloader of packages (hence ignore the quick'n'ugly hack I posted a couple of days ago). I've tested it in both 3.7 and 3.8g and was able to load and unload packages cleanly, with preambles and postscripts run for both loading and unloading. To use it, just file it in and open a new Monticello browser. There you'll find:
1. a new button 'scripts'. Click on it (with a package selected) and it will offer to edit anyone of the four scripts (preamble, postscript, preamble of removal, postscript of removal).
2. a new button 'save as package'. This will save your monticello project as a loadable/unloadable package instead of a simple mcz file.
3. a working 'unload' function. In the package pane, get the menu and choose 'unload'. This now runs the preamble, postscripts of removal around the actual unload process.
4. when filing in the newly created package, it is seen as a normal SAR file and will do the right thing.
Note that the package format will change towards the one that Avi suggested. This change set implements my original suggestion of creating a SAR which contains the install/preamble|postscript and removal/preamble|postscript. I have done this only as a proof of concept, to show you how the new instVars in PackageInfo lead to directly loadable/unloadable package now, today. (The extension of the package file is simply .mcz.sar)
I expect that the package format will change next week to make it a simple mcz file which nows how to store the preambles/postscripts and how to use them on load/unload. But that's an implementation detail, in fact it needs to change only one method in this changset (#createPackageForVersion:).
Enjoy and packagize :)
Michal
ps. I have also attached a trivial Dummy.mcz.sar package. If you load it and unload it in after having filed in the changeset, you'll see how the preambles/postscripts are run.
On Mon, 21 Feb 2005 10:43:42 +0100, Michal michal-list@auf.net wrote:
I expect that the package format will change next week to make it a simple mcz file which nows how to store the preambles/postscripts and how to use them on load/unload. But that's an implementation detail, in fact it needs to change only one method in this changset (#createPackageForVersion:).
Ok,
I've put a couple of new package versions on SqueakSource:
http://squeaksource.com/PackageInfo/PackageInfo-Base-avi.19.mcz
includes your extensions that add #preamble, #postscript, etc to PackageInfo. It's a requirement for
http://squeaksource.com/Monticello/Monticello-avi.227.mcz
which adds new definition types to Monticello for each of those scripts. It also keeps your Scripts button on the WorkingCopyBrowser for editing them.
What this means is that, after loading those two package versions, you can:
- edit preambles, postscripts, etc for a package - any .mcz you save for that package will include them, and they'll be reinstated when you load - each of the four scripts is considered an atomic unit in a merge (if two people change the preamble at once, that's a conflict, etc) - when loading or updating a Monticello package, any new or modified preamble or postscript scripts will get run; when unloading, any existing removal scripts will get run
However:
- these new elements only exist in the binary version of the package, not in the .st file, so MCInstaller won't see them. This could be fixed by coming up with a DoIt format for them, which shouldn't be too hard. Or we could just require that full Monticello be installed to load packages with preambles. - it may be annoying to have a modified preamble/postscript get evaluated when updating a package during development; what behavior do we really want here? - The scripts show up oddly in Monticello's Browse view (though they're ok in the Changes view) - I haven't tested this much, so there are probably bugs
Please test this stuff out and let me know whether to make it part of the published release...
Avi
On Monday 28 February 2005 8:40 am, Avi Bryant wrote:
- I haven't tested this much, so there are probably bugs
Please test this stuff out and let me know whether to make it part of the published release...
I think someone ate your code:
* PackageInfo is missing the mentioned changes to PackageInfo (there are new instance variables, but no new methods)
* The UI changes to the WorkingCopyBrowser aren't there (there is no Scripts button).
* The additions to SARInstaller, etc. are also not there
On Wed, 16 Mar 2005 15:09:38 -0800, Ned Konz ned@squeakland.org wrote:
I think someone ate your code:
It certainly sounds that way. I'm too beat to look into it right now but I'll check it out in the morning.
Avi
- PackageInfo is missing the mentioned changes to PackageInfo (there are new
instance variables, but no new methods)
- The UI changes to the WorkingCopyBrowser aren't there (there is no Scripts
button).
- The additions to SARInstaller, etc. are also not there
-- Ned Konz http://bike-nomad.com/squeak/
On Thu, 17 Mar 2005 01:30:50 +0100, Avi Bryant avi.bryant@gmail.com wrote:
On Wed, 16 Mar 2005 15:09:38 -0800, Ned Konz ned@squeakland.org wrote:
I think someone ate your code:
It certainly sounds that way. I'm too beat to look into it right now but I'll check it out in the morning.
So, yeah, I had forgotten to recategorize some extension methods and overrides. Oops. That's fixed now; look at PackageInfo 19 and Monticello 228 on SqueakSource.
Note that I don't include the SARBuilding extensions, because they're (maybe) not necessary: Monticello just includes all those scripts as normal code elements within the .mcz.
Thanks, Avi
Am 17.03.2005 um 11:34 schrieb Avi Bryant:
On Thu, 17 Mar 2005 01:30:50 +0100, Avi Bryant avi.bryant@gmail.com wrote:
On Wed, 16 Mar 2005 15:09:38 -0800, Ned Konz ned@squeakland.org wrote:
I think someone ate your code:
It certainly sounds that way. I'm too beat to look into it right now but I'll check it out in the morning.
So, yeah, I had forgotten to recategorize some extension methods and overrides. Oops. That's fixed now; look at PackageInfo 19 and Monticello 228 on SqueakSource.
Note that I don't include the SARBuilding extensions, because they're (maybe) not necessary: Monticello just includes all those scripts as normal code elements within the .mcz.
Please, before it's too late, can we just use Strings in a PackageInfo's preamble/post scripts? Currently they are StringHolders, which is a Bad Idea.
I was bitten by this because I tried out the script button in Monticello, and even though I closed the editor without accepting the postscript was stored, saved with a package, so everyone else got a walkback when trying to load that package in an older MC version. Sure, we could fix this while still retaining the StringHolders in there, but why? I'd prefer a clear separation of data and interface.
- Bert -
On Fri, 18 Mar 2005 14:26:01 +0100, Bert Freudenberg bert@impara.de wrote:
Please, before it's too late, can we just use Strings in a PackageInfo's preamble/post scripts? Currently they are StringHolders, which is a Bad Idea.
I was bitten by this because I tried out the script button in Monticello, and even though I closed the editor without accepting the postscript was stored, saved with a package, so everyone else got a walkback when trying to load that package in an older MC version. Sure, we could fix this while still retaining the StringHolders in there, but why? I'd prefer a clear separation of data and interface.
Nasty. We should definitely use Strings. Michal, was there a reason for the StringHolders?
Avi
Am 18.03.2005 um 14:30 schrieb Avi Bryant:
On Fri, 18 Mar 2005 14:26:01 +0100, Bert Freudenberg bert@impara.de wrote:
Please, before it's too late, can we just use Strings in a PackageInfo's preamble/post scripts? Currently they are StringHolders, which is a Bad Idea.
I was bitten by this because I tried out the script button in Monticello, and even though I closed the editor without accepting the postscript was stored, saved with a package, so everyone else got a walkback when trying to load that package in an older MC version. Sure, we could fix this while still retaining the StringHolders in there, but why? I'd prefer a clear separation of data and interface.
Nasty. We should definitely use Strings. Michal, was there a reason for the StringHolders?
I suspect it was just thoughtless copying of code from ChangeSet.
- Bert -
Am 18.03.2005 um 15:19 schrieb Bert Freudenberg:
Am 18.03.2005 um 14:30 schrieb Avi Bryant:
On Fri, 18 Mar 2005 14:26:01 +0100, Bert Freudenberg bert@impara.de wrote:
Please, before it's too late, can we just use Strings in a PackageInfo's preamble/post scripts? Currently they are StringHolders, which is a Bad Idea.
I was bitten by this because I tried out the script button in Monticello, and even though I closed the editor without accepting the postscript was stored, saved with a package, so everyone else got a walkback when trying to load that package in an older MC version. Sure, we could fix this while still retaining the StringHolders in there, but why? I'd prefer a clear separation of data and interface.
Nasty. We should definitely use Strings. Michal, was there a reason for the StringHolders?
I suspect it was just thoughtless copying of code from ChangeSet.
And while you're at it: PackageList, which is a Morphic interface, should not be in PackageInfo-Base, IMHO.
- Bert -
On Fri, 18 Mar 2005 15:55:18 +0100, Bert Freudenberg bert@impara.de wrote:
And while you're at it: PackageList, which is a Morphic interface, should not be in PackageInfo-Base, IMHO.
It should probably just be removed - it was meant to demonstrate the registry of package context menu actions, which never really caught on and will probably be made obsolete by something more general like Services or Pragmas anyway.
Bert, I've added both you and Ned as developers/co-maintainers on PackageInfo and Monticello, in SqueakSource and SqueakMap. No need for me to be a bottleneck here.
Avi
Nasty. We should definitely use Strings. Michal, was there a reason for the StringHolders?
I suspect it was just thoughtless copying of code from ChangeSet.
Not entirely thoughtless (in fact strings were the first thing I used), but taken from ChangeSet yes. Doing it this way allowed both a cleaner interface with PackageInfo and a trivial editing method.
But sure, we can easily switch back, add a series of methods of the #preambleString: type to PackageInfo (I think I deleted them from the version I sent out - I don't have an image here to check), and build a different editor for the preambles/postscripts.
(I'm leaving tomorrow for 3 weeks, so won't be able to do it myself)
Michal
ps. Avi, thanks for packaging this and integrating it with the Monticello format.
squeak-dev@lists.squeakfoundation.org