On Mon, Aug 23, 2010 at 6:32 PM, Dale Henrichs <dhenrich@vmware.com> wrote:
Is Gofer preloaded in Squeak?

The #ensureMetacello is intended to work on all platforms. For earlier versions of Pharo, gofer had to be loaded before Metacello could be loaded and if Gofer isn't preloaded in Squeak, then we still have that problem.

I guess I should say that _I_ have that problem, because I am interested in configurations that can be used with any Smalltalk that supports Monticello:)


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

Dale


Tudor Girba wrote:
Indeed, now we could add this method in Gofer.

Cheers,
Doru


On 20 Aug 2010, at 16:01, Mariano Martinez Peck wrote:


On Fri, Aug 20, 2010 at 3:54 PM, St�phane Ducasse <stephane.ducasse@inria.fr
wrote:

The problem is in ConfigurationOfRPackage as in #ensureMetacello �
is like this:
ensureMetacello
� �Smalltalk at: #MetacelloProject ifAbsent: [
� � � �Gofer new
� � � � � � � �disableRepositoryErrors;
� � � � � � � �url: 'http://seaside.gemstone.com/ss/metacello';
� � � � � � � �package: 'ConfigurationOfMetacello';
� � � � � � � �load.
� � � �(Smalltalk at: #ConfigurationOfMetacello) project �
latestVersion load: #('default' 'UI') ]

I hate the fact that we should copy all the code around....
what a crap.

This was discussed several, severaaaaal times. As I remember the �problem was that otherwise you class depends on a base class that �should be included in the image you are working on.
But I guess we don't have problem to add such base class in �PharoCore...if we have Gofer..



If you see, it is loading #('default' 'UI') �of metacello..... UI - OB.

change that to #('default') and wala

BTW, I would use the latest recommended #ensureMetacello:

http://code.google.com/p/metacello/wiki/EnsureMetacello

cheers

mariano


And stuck because OB does not load in 1.2 so I lost one hour...... �
boring.
Stef


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
www.tudorgirba.com

"Live like you mean it."


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project