I want to say a couple of things:
0) Objective? Don't need to write #ensureMetacello in each conf as it is 99% times the same and we don't want to update each conf to the latest ensureMetacello that is in the wiki
1) I don't know if Gofer works or is preloaded in Squeak. But what I really think is that if Squeak wants to "officially" supports Metacello, then they should be ready to integrate things. Ok, maybe not a complete package like Gofer, but at least some messages or something that would be of help.
2) What about providing a solution that works for different cases. For example, the following come to my mind (of course, hacky, but you can make it better for sure):
- we can creat Object>>ensureMetacello� in squeak, phaor, gemstone. Okokoko, puting those methods in Object sucks..but if you have a better idea :)
Then, in Pharo we can implement it this way:
Object >> ensureMetacello
������ Gofer ensureMetacelloCore
Gofer >> ensureMetacelloCore
� � � � "Bootstrap Gofer (if necessary), load latest mcz file for ConfigurationOfMetacello (using old
� � � � �Gofer API), then load the latest version of Metacello itself."
� � � � Smalltalk at: #MetacelloProject ifAbsent: [ | error |
� � � � � � � � "list of repositories to try, in case primary repository is not accessible"
� � � � � � � � (Array
� � � � � � � � � � � � with: '
http://www.squeaksource.com/MetacelloRepository'
� � � � � � � � � � � � with: '
http://seaside.gemstone.com/ss/metacello') do: [:repositoryUrl |
� � � � � � � � � � � � � � � � ([
� � � � � � � � � � � � � � � � � � � � Smalltalk at: #Gofer ifAbsent: [
� � � � � � � � � � � � � � � � � � � � "Current version of Gofer from which to bootstrap - as of 1.0-beta.21"
� � � � � � � � � � � � � � � � � � � � � � � � self bootstrapPackage: 'Gofer-Core-lr.115' from: repositoryUrl ].
� � � � � � � � � � � � � � � � � � � � Smalltalk at: #Gofer ifPresent: [:goferClass | | gofer |
� � � � � � � � � � � � � � � � � � � � � � � � gofer := goferClass new
� � � � � � � � � � � � � � � � � � � � � � � � � � � � url: repositoryUrl;
� � � � � � � � � � � � � � � � � � � � � � � � � � � � yourself.
� � � � � � � � � � � � � � � � � � � � � � � � [ gofer addPackage: 'ConfigurationOfMetacello' ] on: Warning do: [:ex | ex resume ].
� � � � � � � � � � � � � � � � � � � � � � � � gofer load ]]
� � � � � � � � � � � � � � � � � � � � � � � � � � � � on: Error
� � � � � � � � � � � � � � � � � � � � � � � � � � � � do: [ :ex |
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � error := ex.
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Transcript
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � cr;
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � show: 'failed ensureMetacello: ';
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � show: ex description printString;
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � show: '...retrying'.
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � "try again"
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ex return: nil ]) ~~ nil
� � � � � � � � � � � � � � � � � � � � ifTrue: [
� � � � � � � � � � � � � � � � � � � � � � � � "load 'default' group of Metacello"
� � � � � � � � � � � � � � � � � � � � � � � � (Smalltalk at: #ConfigurationOfMetacello) perform: #load.
� � � � � � � � � � � � � � � � � � � � � � � � ^self ]].
� � � � � � � � "shouldn't get here unless the load failed ... throw an error"
� � � � � � � � self error: 'retry with alternate repository failed: ', error description printString ]
�
here we can even remove the ifFalse if Gofer is not present...since in Pharo it is present.
So...in Pharo, if you have specified ensureMetacello in your Conf...then perfect. That one will be use. If you don't want to implement it and let it as default (like 99% of the cases), self ensureMetacello would be object, which will delegate to Gofer, who will load the Metacello Core.
In Squeak, it can be as it is now. They can use they own ensureMetacello (the difference here is that they HAVE to implement such method as they don't have it in they own image).
Maybe they can even implement ensureMetacello in object using Installer or whatever they have in the core to load monticello packages.
If #ensureMetacello has to be updated we only need to change Gofer>>ensureMetacello and not all the confs.
Those who need to load a different Metacello version, different groups, or from different repo, they just implement #ensureMetacello in their OWN conf and that's all. For example, I can do this in ConfigurationOfPharo as I need not only core, but UI and tests.
Now that I am thinking it...my "idea" is outside Metacello. The problem is that if someone writes a conf, without #ensureMetacello, it will load fine in Pharo but will fail in Squeak.
what do you think?
cheers
Mariano