MC conventions (was Re: [squeak-dev] The Trunk: Installer-Core-cmm.346.mcz)

Bert Freudenberg bert at freudenbergs.de
Wed Apr 6 09:44:42 UTC 2011


On 06.04.2011, at 09:57, Levente Uzonyi wrote:

> On Wed, 6 Apr 2011, commits at source.squeak.org wrote:
> 
>> Chris Muller uploaded a new version of Installer-Core to project The Trunk:
>> http://source.squeak.org/trunk/Installer-Core-cmm.346.mcz
>> 
>> ==================== Summary ====================
>> 
>> Name: Installer-Core-cmm.346
>> Author: cmm
>> Time: 5 April 2011, 9:45:13.488 pm
>> UUID: c579dac3-6487-4420-a28d-5bb93c029215
>> Ancestors: Installer-Core-cmm.345
>> 
>> - Quick-fix for Installer; to be able to specify packages either with or without a version-number.
> 
> When I wrote prefix matching, I really meant it. It's a feature of Installer. The following used to work:
> 
> Installer squeaksource
> 	project: 'OCompletion';
> 	install: 'Ocomple';
> 	install: 'Ocompletion';
> 	install: 'Ocompletion-';
> 	install: 'Ocompletion-u';
> 	install: 'Ocompletion-ul';
> 	install: 'Ocompletion-ul.';
> 	install: 'Ocompletion-ul.8';
> 	install: 'Ocompletion-ul.86';
> 	install: 'Ocompletion-ul.86.'
> 
> Here's a real script from the Xtreams repository (www.squeaksource.com/Xtreams.html ) using this feature:
> 
> Installer squeaksource
> 	project: 'Xtreams';
> 	install: 'Xtreams-Support';
> 	install: 'Xtreams-Core-';
> 	install: 'Xtreams-Terminals-';
> 	install: 'Xtreams-Transforms-';
> 	install: 'Xtreams-Substreams-';
> 	install: 'Xtreams-Parsing-';
> 	" --- tests follow --- "
> 	install: 'Xtreams-CoreTests';
> 	install: 'Xtreams-TerminalsTests';
> 	install: 'Xtreams-TransformsTests';
> 	install: 'Xtreams-SubstreamsTests';
> 	install: 'Xtreams-ParsingTests';
> 	" --- following require FFI --- "
> 	install: 'Xtreams-Xtras-';
> 	install: 'Xtreams-XtrasTests'.
> 
> Actually the dash at the end of the package names is mandatory because of prefix matching. Without those Installer used to install the tests if those have higher version numbers.
> 
> I consider removing the prefix matching a good idea, but we should care about backwards compatibility too.
> 
> 
> Levente

Yes.  But we should decide which of the conventions to actually put into the code. And where to put it. IMHO Installer could make more assumptions than MC itself.

E.g., Monticello was designed to not care about version names at all. It just looks at the file name extension to decide which reader class to use. Apart from that, the filename can be anything. That's why the version name field when saving a package snapshot is freely editable. It doesn't even have to match the package name, because the package name is part of the meta data stored inside the mcz. And to identify the exact version, its GUID is used.

The only place in MC making assumptions about the meaning of filenames used to be in its UI. It still shows all the files, but for filtering, ordering, and highlighting it analyzes the name, assuming our convention of "packageName-versionId" with the version id being "anythingExceptDash.integer". MCDs append the base version id in parenthesis, so this is stripped first.

The recently introduced MCVersionName tries to push these conventions into MC itself, which IMHO is not a good idea. It is reasonable to put all the file name parsing in one place. But making it part of the MC data model is wrong. It could be part of the UI, or a utility, but putting it in 'Monticello-Modeling' gives it way too much weight.

The UI does not pick a particular version, it just presents an ordered list. The user has to select a file and load it. Where it gets interesting is with code that tries to automate this, be it Installer or the configuration-based updates. 

The problem I see with string prefix matching is that it is counter-intuitive. It's a sound technical solution for picking a particular file to load, but to me those trailing dashes in the Xtreams script are irritating. That's a good place to use MCVersionName for analyzing the filenames, ordering them, picking the newest one etc. It seems reasonably simple to allow that Xtreams script to continue to work (by stripping trailing dashes) but disallow partial matches like 'Ocompletion-u' which is just plain confusing.

Sorry for the rant about MCVersionName, but if we are changing the semantics of core parts of the system, I think we should at least be aware of it. 

- Bert -





More information about the Squeak-dev mailing list