[squeak-dev] Constructing a patched Monticello package without installing it

Eliot Miranda eliot.miranda at gmail.com
Wed Jan 15 21:46:01 UTC 2014


Thanks Colin!

On Wed, Jan 15, 2014 at 12:06 PM, Colin Putney <colin at wiresong.com> wrote:

>
>
>
> On Wed, Jan 15, 2014 at 1:41 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
>
>
>> I just stumbled across Monticello's MCPatcher and the Backport button
>> which claims to apply a partial delta to the ancestor of a package.  Does
>> anyone who understands this code know if the code supports loading a
>> package, without installing it, applying a partial set of changes (i.e. the
>> relevant changes form the bootstrap) and saving the package as an mcz?  If
>> it does then I could construct patched versions of the three packages and
>> substitute them in the bootstrap instead of using the hack.
>>
>
>  Yeah, that ought to work fine. There's no way to do it through the GUI,
> but a bit of workspace hackery should do the trick.
>

Here's a working example that patches a single method:

| fn fs version method patch ancestry newVersion |
fn :=
'/Users/eliot/Glue/repositories/spurnsboot/smalltalk/Kernel.newspeak-bwesterg.682.mcz'.
fs := FileStream readOnlyFileNamed: fn.
version := [((MCVersionReader readerClassForFileNamed: fn) on: fs fileName:
fn) version] ensure: [fs close].
method := SpurBootstrap class >> #ProtoObjectPROTOTYPEscaledIdentityHash.
patch := MCPatch operations: {MCAddition of: (MCMethodDefinition
className: #ProtoObject
classIsMeta: false
selector: #scaledIdentityHash
category: #comparing
timeStamp: method timeStamp
source: (method getSourceFromFile asString allButFirst: 20))}.
ancestry := MCWorkingAncestry new addAncestor: version info.
newVersion := MCVersion
 package: version package
info: (ancestry
infoWithName: 'Kernel.newspeak.spur-bwesterg.682.mcz'
message: 'Kernel.newspeak-bwesterg.682.mcz patched for Spur')
snapshot: (MCPatcher apply: patch to: version snapshot)
dependencies: {}.
(MCDirectoryRepository new directory: fs directory) storeVersion:
newVersion

-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140115/dabf836a/attachment.htm


More information about the Squeak-dev mailing list