The Inbox: System-fbs.523.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: System-fbs.523.mcz

commits-2
Frank Shearar uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-fbs.523.mcz

==================== Summary ====================

Name: System-fbs.523
Author: fbs
Time: 12 April 2013, 12:31:41.197 pm
UUID: 1108f479-b229-443c-95ff-bac883d49444
Ancestors: System-bf.522

There's more to removing a package than meets the eye: once you've removed the package, you need to remove various references to entities in the package. Removing the code might also empty method categories (which should therefore be deleted). Monticello state needs clearing. And so on.

SmalltalkImage >> #unloadPackages: takes a collection of package names (hence strings) and performs this cleanup after removing the packages from the image.

=============== Diff against System-bf.522 ===============

Item was added:
+ ----- Method: SmalltalkImage>>unloadPackages: (in category 'shrinking') -----
+ unloadPackages: somePackageNames
+ "Go unloading"
+ somePackageNames do: [:pkgName|
+ (MCPackage named: pkgName) unload.
+ MCMcmUpdater disableUpdatesOfPackage: pkgName.
+ ].
+
+ "Post-unload cleanup"
+ MCWorkingCopy flushObsoletePackageInfos.
+ SystemOrganization removeEmptyCategories.
+ globals undeclared removeUnreferencedKeys.
+ MCFileBasedRepository flushAllCaches.
+ MCDefinition clearInstances.
+ Behavior flushObsoleteSubclasses.
+ Smalltalk flushClassNameCache.
+ AppRegistry removeObsolete.
+ FileServices removeObsolete.
+ Preferences removeObsolete.
+ TheWorldMenu removeObsolete.
+ Smalltalk garbageCollect.
+ Symbol compactSymbolTable.
+ TheWorldMainDockingBar updateInstances.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 12 April 2013 12:32,  <[hidden email]> wrote:

> Frank Shearar uploaded a new version of System to project The Inbox:
> http://source.squeak.org/inbox/System-fbs.523.mcz
>
> ==================== Summary ====================
>
> Name: System-fbs.523
> Author: fbs
> Time: 12 April 2013, 12:31:41.197 pm
> UUID: 1108f479-b229-443c-95ff-bac883d49444
> Ancestors: System-bf.522
>
> There's more to removing a package than meets the eye: once you've removed the package, you need to remove various references to entities in the package. Removing the code might also empty method categories (which should therefore be deleted). Monticello state needs clearing. And so on.
>
> SmalltalkImage >> #unloadPackages: takes a collection of package names (hence strings) and performs this cleanup after removing the packages from the image.
>
> =============== Diff against System-bf.522 ===============

This goes in the inbox because I know very little about the arcana
surrounding unloading packages. Well, OK, I know enough to get myself
in trouble.

If the above's acceptable, then I'll recreate the base 4.5 image by
taking the Official 4.4 Image and updating from Trunk, and then using
this guy to unload Nebraska, XML-Parser and Universes. That will give
us a new 4.5 without manually fiddling with state (and I really,
really want to avoid manual fiddling with state).

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Bert Freudenberg
In reply to this post by commits-2

On 12.04.2013, at 11:32, [hidden email] wrote:

> Frank Shearar uploaded a new version of System to project The Inbox:
> http://source.squeak.org/inbox/System-fbs.523.mcz
>
> ==================== Summary ====================
>
> Name: System-fbs.523
> Author: fbs
> Time: 12 April 2013, 12:31:41.197 pm
> UUID: 1108f479-b229-443c-95ff-bac883d49444
> Ancestors: System-bf.522
>
> There's more to removing a package than meets the eye: once you've removed the package, you need to remove various references to entities in the package. Removing the code might also empty method categories (which should therefore be deleted). Monticello state needs clearing. And so on.
>
> SmalltalkImage >> #unloadPackages: takes a collection of package names (hence strings) and performs this cleanup after removing the packages from the image.
>
> =============== Diff against System-bf.522 ===============
>
> Item was added:
> + ----- Method: SmalltalkImage>>unloadPackages: (in category 'shrinking') -----
> + unloadPackages: somePackageNames
> + "Go unloading"
> + somePackageNames do: [:pkgName|
> + (MCPackage named: pkgName) unload.
> + MCMcmUpdater disableUpdatesOfPackage: pkgName.
> + ].
> +
> + "Post-unload cleanup"
> + MCWorkingCopy flushObsoletePackageInfos.
> + SystemOrganization removeEmptyCategories.
> + globals undeclared removeUnreferencedKeys.
> + MCFileBasedRepository flushAllCaches.
> + MCDefinition clearInstances.
> + Behavior flushObsoleteSubclasses.
> + Smalltalk flushClassNameCache.
> + AppRegistry removeObsolete.
> + FileServices removeObsolete.
> + Preferences removeObsolete.
> + TheWorldMenu removeObsolete.
> + Smalltalk garbageCollect.
> + Symbol compactSymbolTable.
> + TheWorldMainDockingBar updateInstances.!


I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).

That being said, I'm not sure this method should be in System at all - seems more of a Monticello thing? Do we have other MC dependencies in System already?

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:

>
> On 12.04.2013, at 11:32, [hidden email] wrote:
>
>> Frank Shearar uploaded a new version of System to project The Inbox:
>> http://source.squeak.org/inbox/System-fbs.523.mcz
>>
>> ==================== Summary ====================
>>
>> Name: System-fbs.523
>> Author: fbs
>> Time: 12 April 2013, 12:31:41.197 pm
>> UUID: 1108f479-b229-443c-95ff-bac883d49444
>> Ancestors: System-bf.522
>>
>> There's more to removing a package than meets the eye: once you've removed the package, you need to remove various references to entities in the package. Removing the code might also empty method categories (which should therefore be deleted). Monticello state needs clearing. And so on.
>>
>> SmalltalkImage >> #unloadPackages: takes a collection of package names (hence strings) and performs this cleanup after removing the packages from the image.
>>
>> =============== Diff against System-bf.522 ===============
>>
>> Item was added:
>> + ----- Method: SmalltalkImage>>unloadPackages: (in category 'shrinking') -----
>> + unloadPackages: somePackageNames
>> +     "Go unloading"
>> +     somePackageNames do: [:pkgName|
>> +                     (MCPackage named: pkgName) unload.
>> +                     MCMcmUpdater disableUpdatesOfPackage: pkgName.
>> +                     ].
>> +
>> +     "Post-unload cleanup"
>> +     MCWorkingCopy flushObsoletePackageInfos.
>> +     SystemOrganization removeEmptyCategories.
>> +     globals undeclared removeUnreferencedKeys.
>> +     MCFileBasedRepository flushAllCaches.
>> +     MCDefinition clearInstances.
>> +     Behavior flushObsoleteSubclasses.
>> +     Smalltalk flushClassNameCache.
>> +     AppRegistry removeObsolete.
>> +     FileServices removeObsolete.
>> +     Preferences removeObsolete.
>> +     TheWorldMenu removeObsolete.
>> +     Smalltalk garbageCollect.
>> +     Symbol compactSymbolTable.
>> +     TheWorldMainDockingBar updateInstances.!
>
>
> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).

OK. There are far too few implementors of #cleanUp: then. I agree with
your sentiment. So to reimplement the idea of this method, we'd want
TheWorldMenu >> #cleanUp:, Preferences >> #cleanUp:, and so on?

> That being said, I'm not sure this method should be in System at all - seems more of a Monticello thing? Do we have other MC dependencies in System already?

Well, it's a rip-off of SmalltalkImage >> #unloadAllKnownPackages, but
I agree with the sentiment: System shouldn't depend on Monticello, or
Morphic (!), or...

frank

> - Bert -
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Bert Freudenberg
On 12.04.2013, at 11:07, Frank Shearar <[hidden email]> wrote:

> There are far too few implementors of #cleanUp: then.

Actually, there are very many implementers of #cleanUp. Only for aggressive clean up (e.g. release image building) you need to implement cleanUp:.

> I agree with
> your sentiment. So to reimplement the idea of this method, we'd want
> TheWorldMenu >> #cleanUp:

Already implemented as cleanUp.

> Preferences >> #cleanUp:, and so on?

That one we need apparently. But again, #cleanUp is sufficient.

>> That being said, I'm not sure this method should be in System at all - seems more of a Monticello thing? Do we have other MC dependencies in System already?
>
> Well, it's a rip-off of SmalltalkImage >> #unloadAllKnownPackages, but
> I agree with the sentiment: System shouldn't depend on Monticello, or
> Morphic (!), or...
>
> frank


:)

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 12 April 2013 19:15, Bert Freudenberg <[hidden email]> wrote:

> On 12.04.2013, at 11:07, Frank Shearar <[hidden email]> wrote:
>
>> There are far too few implementors of #cleanUp: then.
>
> Actually, there are very many implementers of #cleanUp. Only for aggressive clean up (e.g. release image building) you need to implement cleanUp:.
>
>> I agree with
>> your sentiment. So to reimplement the idea of this method, we'd want
>> TheWorldMenu >> #cleanUp:
>
> Already implemented as cleanUp.
>
>> Preferences >> #cleanUp:, and so on?
>
> That one we need apparently. But again, #cleanUp is sufficient.

Ah. I followed the chain of SmalltalkImage >> #cleanUp -> #cleanUp: ->
... -> #cleanUp:except:confirming: and figured that #cleanUp: was the
desired approach. Glad to see I have less to do!

frank

>>> That being said, I'm not sure this method should be in System at all - seems more of a Monticello thing? Do we have other MC dependencies in System already?
>>
>> Well, it's a rip-off of SmalltalkImage >> #unloadAllKnownPackages, but
>> I agree with the sentiment: System shouldn't depend on Monticello, or
>> Morphic (!), or...
>>
>> frank
>
>
> :)
>
> - Bert -
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
In reply to this post by Bert Freudenberg
On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>
> On 12.04.2013, at 11:32, [hidden email] wrote:
>
>> Frank Shearar uploaded a new version of System to project The Inbox:
>> http://source.squeak.org/inbox/System-fbs.523.mcz
<snip>

> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).

So just to be clear you mean unloading packages should be:

unloadPackages: somePackageNames
    "Go unloading"
    somePackageNames do: [:pkgName|
                    (MCPackage named: pkgName) unload.
                    MCMcmUpdater disableUpdatesOfPackage: pkgName.
                    ].
    Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
#cleanUp: of obsolete PackageInfos; could of course change that method
to always do this."

where we have another commit implementing Preferences >> #cleanUp ?

frank

> - Bert -

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Bert Freudenberg

On 13.04.2013, at 08:05, Frank Shearar <[hidden email]> wrote:

> On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>>
>> On 12.04.2013, at 11:32, [hidden email] wrote:
>>
>>> Frank Shearar uploaded a new version of System to project The Inbox:
>>> http://source.squeak.org/inbox/System-fbs.523.mcz
> <snip>
>
>> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).
>
> So just to be clear you mean unloading packages should be:
>
> unloadPackages: somePackageNames
>    "Go unloading"
>    somePackageNames do: [:pkgName|
>                    (MCPackage named: pkgName) unload.
>                    MCMcmUpdater disableUpdatesOfPackage: pkgName.
>                    ].
>    Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
> #cleanUp: of obsolete PackageInfos; could of course change that method
> to always do this."

It should *not* flush all PackageInfos, but only the ones that were actually unloaded. And possibly that should happen in #unload itself.

> where we have another commit implementing Preferences >> #cleanUp ?
>
> frank


No, "cleanUp: true" should only be done in the release process, or manually, because it will actually modify the image beyond emptying caches. E.g., I might like keeping package infos around even if there is no associated MC package. The system should not simply discard them. Same for empty system categories: If I create a category manually, the system should not simply trash it. Etc.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 13 April 2013 18:25, Bert Freudenberg <[hidden email]> wrote:

>
> On 13.04.2013, at 08:05, Frank Shearar <[hidden email]> wrote:
>
>> On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>>>
>>> On 12.04.2013, at 11:32, [hidden email] wrote:
>>>
>>>> Frank Shearar uploaded a new version of System to project The Inbox:
>>>> http://source.squeak.org/inbox/System-fbs.523.mcz
>> <snip>
>>
>>> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).
>>
>> So just to be clear you mean unloading packages should be:
>>
>> unloadPackages: somePackageNames
>>    "Go unloading"
>>    somePackageNames do: [:pkgName|
>>                    (MCPackage named: pkgName) unload.
>>                    MCMcmUpdater disableUpdatesOfPackage: pkgName.
>>                    ].
>>    Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
>> #cleanUp: of obsolete PackageInfos; could of course change that method
>> to always do this."
>
> It should *not* flush all PackageInfos, but only the ones that were actually unloaded. And possibly that should happen in #unload itself.
>
>> where we have another commit implementing Preferences >> #cleanUp ?
>>
>> frank
>
>
> No, "cleanUp: true" should only be done in the release process, or manually, because it will actually modify the image beyond emptying caches. E.g., I might like keeping package infos around even if there is no associated MC package. The system should not simply discard them. Same for empty system categories: If I create a category manually, the system should not simply trash it. Etc.

That sounds like exactly the _right_ thing to do, but perhaps I should
indicate that by putting this method with the ReleaseBuilder. Because
this _is_ about a release-making like process, in that I'm wanting to
cut things out of the image... but at the moment the 4.5 image I use
had things ripped out in an untidy manner.

frank

> - Bert -
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 13 April 2013 19:19, Frank Shearar <[hidden email]> wrote:

> On 13 April 2013 18:25, Bert Freudenberg <[hidden email]> wrote:
>>
>> On 13.04.2013, at 08:05, Frank Shearar <[hidden email]> wrote:
>>
>>> On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>>>>
>>>> On 12.04.2013, at 11:32, [hidden email] wrote:
>>>>
>>>>> Frank Shearar uploaded a new version of System to project The Inbox:
>>>>> http://source.squeak.org/inbox/System-fbs.523.mcz
>>> <snip>
>>>
>>>> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).
>>>
>>> So just to be clear you mean unloading packages should be:
>>>
>>> unloadPackages: somePackageNames
>>>    "Go unloading"
>>>    somePackageNames do: [:pkgName|
>>>                    (MCPackage named: pkgName) unload.
>>>                    MCMcmUpdater disableUpdatesOfPackage: pkgName.
>>>                    ].
>>>    Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
>>> #cleanUp: of obsolete PackageInfos; could of course change that method
>>> to always do this."
>>
>> It should *not* flush all PackageInfos, but only the ones that were actually unloaded. And possibly that should happen in #unload itself.
>>
>>> where we have another commit implementing Preferences >> #cleanUp ?
>>>
>>> frank
>>
>>
>> No, "cleanUp: true" should only be done in the release process, or manually, because it will actually modify the image beyond emptying caches. E.g., I might like keeping package infos around even if there is no associated MC package. The system should not simply discard them. Same for empty system categories: If I create a category manually, the system should not simply trash it. Etc.
>
> That sounds like exactly the _right_ thing to do, but perhaps I should
> indicate that by putting this method with the ReleaseBuilder. Because
> this _is_ about a release-making like process, in that I'm wanting to
> cut things out of the image... but at the moment the 4.5 image I use
> had things ripped out in an untidy manner.

Actually, no. I don't want to clean the world. I want to remove every
trace of a particular package, and this unloadPackages: should
aggressively clean up only that state associated with the package:
strip menu items, registered apps, and so on. So it shouldn't call
Smalltalk cleanUp at all, aggressive or otherwise, I would think.

frank

> frank
>
>> - Bert -
>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Bert Freudenberg

On 13.04.2013, at 11:24, Frank Shearar <[hidden email]> wrote:

> On 13 April 2013 19:19, Frank Shearar <[hidden email]> wrote:
>> On 13 April 2013 18:25, Bert Freudenberg <[hidden email]> wrote:
>>>
>>> On 13.04.2013, at 08:05, Frank Shearar <[hidden email]> wrote:
>>>
>>>> On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>>>>>
>>>>> On 12.04.2013, at 11:32, [hidden email] wrote:
>>>>>
>>>>>> Frank Shearar uploaded a new version of System to project The Inbox:
>>>>>> http://source.squeak.org/inbox/System-fbs.523.mcz
>>>> <snip>
>>>>
>>>>> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).
>>>>
>>>> So just to be clear you mean unloading packages should be:
>>>>
>>>> unloadPackages: somePackageNames
>>>>   "Go unloading"
>>>>   somePackageNames do: [:pkgName|
>>>>                   (MCPackage named: pkgName) unload.
>>>>                   MCMcmUpdater disableUpdatesOfPackage: pkgName.
>>>>                   ].
>>>>   Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
>>>> #cleanUp: of obsolete PackageInfos; could of course change that method
>>>> to always do this."
>>>
>>> It should *not* flush all PackageInfos, but only the ones that were actually unloaded. And possibly that should happen in #unload itself.
>>>
>>>> where we have another commit implementing Preferences >> #cleanUp ?
>>>>
>>>> frank
>>>
>>>
>>> No, "cleanUp: true" should only be done in the release process, or manually, because it will actually modify the image beyond emptying caches. E.g., I might like keeping package infos around even if there is no associated MC package. The system should not simply discard them. Same for empty system categories: If I create a category manually, the system should not simply trash it. Etc.
>>
>> That sounds like exactly the _right_ thing to do, but perhaps I should
>> indicate that by putting this method with the ReleaseBuilder. Because
>> this _is_ about a release-making like process, in that I'm wanting to
>> cut things out of the image... but at the moment the 4.5 image I use
>> had things ripped out in an untidy manner.
>
> Actually, no. I don't want to clean the world. I want to remove every
> trace of a particular package, and this unloadPackages: should
> aggressively clean up only that state associated with the package:
> strip menu items, registered apps, and so on. So it shouldn't call
> Smalltalk cleanUp at all, aggressive or otherwise, I would think.
>
> frank


The regular Smalltalk cleanUp should be perfectly safe to call any time. So you would only need to implement the stuff specific to package unloading.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Frank Shearar-3
On 13 April 2013 19:27, Bert Freudenberg <[hidden email]> wrote:

>
> On 13.04.2013, at 11:24, Frank Shearar <[hidden email]> wrote:
>
>> On 13 April 2013 19:19, Frank Shearar <[hidden email]> wrote:
>>> On 13 April 2013 18:25, Bert Freudenberg <[hidden email]> wrote:
>>>>
>>>> On 13.04.2013, at 08:05, Frank Shearar <[hidden email]> wrote:
>>>>
>>>>> On 12 April 2013 19:00, Bert Freudenberg <[hidden email]> wrote:
>>>>>>
>>>>>> On 12.04.2013, at 11:32, [hidden email] wrote:
>>>>>>
>>>>>>> Frank Shearar uploaded a new version of System to project The Inbox:
>>>>>>> http://source.squeak.org/inbox/System-fbs.523.mcz
>>>>> <snip>
>>>>>
>>>>>> I'd rather use "Smalltalk cleanUp" which does almost all of what you listed. This is more future-proof. If something is missing, add it to the cleanUp mechanism (that is, implement a class-side cleanUp or cleanUp: method).
>>>>>
>>>>> So just to be clear you mean unloading packages should be:
>>>>>
>>>>> unloadPackages: somePackageNames
>>>>>   "Go unloading"
>>>>>   somePackageNames do: [:pkgName|
>>>>>                   (MCPackage named: pkgName) unload.
>>>>>                   MCMcmUpdater disableUpdatesOfPackage: pkgName.
>>>>>                   ].
>>>>>   Smalltalk cleanUp: true. "Needed to trigger the MCWorkingCopy's
>>>>> #cleanUp: of obsolete PackageInfos; could of course change that method
>>>>> to always do this."
>>>>
>>>> It should *not* flush all PackageInfos, but only the ones that were actually unloaded. And possibly that should happen in #unload itself.
>>>>
>>>>> where we have another commit implementing Preferences >> #cleanUp ?
>>>>>
>>>>> frank
>>>>
>>>>
>>>> No, "cleanUp: true" should only be done in the release process, or manually, because it will actually modify the image beyond emptying caches. E.g., I might like keeping package infos around even if there is no associated MC package. The system should not simply discard them. Same for empty system categories: If I create a category manually, the system should not simply trash it. Etc.
>>>
>>> That sounds like exactly the _right_ thing to do, but perhaps I should
>>> indicate that by putting this method with the ReleaseBuilder. Because
>>> this _is_ about a release-making like process, in that I'm wanting to
>>> cut things out of the image... but at the moment the 4.5 image I use
>>> had things ripped out in an untidy manner.
>>
>> Actually, no. I don't want to clean the world. I want to remove every
>> trace of a particular package, and this unloadPackages: should
>> aggressively clean up only that state associated with the package:
>> strip menu items, registered apps, and so on. So it shouldn't call
>> Smalltalk cleanUp at all, aggressive or otherwise, I would think.
>>
>> frank
>
>
> The regular Smalltalk cleanUp should be perfectly safe to call any time. So you would only need to implement the stuff specific to package unloading.

Oh, ok, so at the risk of being really slow, you're saying that this
would be sufficient to (a) cleanly remove all trace of a package and
(b) respect the rest of the image's current state:

unloadPackages: somePackageNames
    "Remove the given packages from the system, including any
registered applications, menu items, and the like."
    somePackageNames do: [:pkgName|
        (MCPackage named: pkgName) unload.
        MCMcmUpdater disableUpdatesOfPackage: pkgName].
    Smalltalk cleanUp

frank

> - Bert -
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.523.mcz

Bert Freudenberg
On 13.04.2013, at 11:46, Frank Shearar <[hidden email]> wrote:

> On 13 April 2013 19:27, Bert Freudenberg <[hidden email]> wrote:
>>
>> The regular Smalltalk cleanUp should be perfectly safe to call any time. So you would only need to implement the stuff specific to package unloading.
>
> Oh, ok, so at the risk of being really slow, you're saying that this
> would be sufficient to (a) cleanly remove all trace of a package and
> (b) respect the rest of the image's current state:
>
> unloadPackages: somePackageNames
>    "Remove the given packages from the system, including any
> registered applications, menu items, and the like."
>    somePackageNames do: [:pkgName|
>        (MCPackage named: pkgName) unload.
>        MCMcmUpdater disableUpdatesOfPackage: pkgName].
>    Smalltalk cleanUp


Not sure about (a) but (b) should be true (if not, it's a bug).

For (a), possibly MCPackage>>unload needs to do something extra, or your #unloadPackages: would need to do something extra per package. E.g. unloading a package should remove that package's categories, both for classes and extension methods. If it doesn't, that needs to be fixed.

- Bert -