[squeak-dev] The Inbox: System-fbs.523.mcz

Frank Shearar frank.shearar at gmail.com
Fri Apr 12 18:07:57 UTC 2013


On 12 April 2013 19:00, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On 12.04.2013, at 11:32, commits at source.squeak.org 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 -
>
>


More information about the Squeak-dev mailing list