question about repositoryOverrides:

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

question about repositoryOverrides:

Mariano Martinez Peck
Hi Dale. I am trying to understand repositoryOverrides: and I come to two questions that you may help me.

 All the examples I saw for repositoryOverrides:   are done from a workspace, to load a version. Example:

| localRepository version |
localRepository :=
MCDirectoryRepository new
directory: (FileDirectory on: '/home/dhenrich/monticello').
version := ConfigurationOfMagritte project version: '1.2.1.3'.
"set the repositoryOverrides"
version repositoryOverrides
: (Array with: localRepository).
"do the load"

version load.


or:

 | project version repo |
 project := self project.
 version := project version: '1.0'.
 repo := MCDiDirectoryRepository new.
 repo directory: FileDirectory on: '<path to directory>'.
 version repositoryOverrides: (OrderedCollection with: repo).
 version load.


Now...this is only done from a workspace, but can I do this with a project reference?  Suppose the above code loads ConfigurationOfPharo. Ok, that mcz (ConfigurationOfPharo) will be download from the localRepository instead of MetacelloRepository. But, what happens with:

a) the repositories I have specified in  self repository:  of ConfigurationOfPharo
b) the repositories I have specified in a project reference. Example:

project: 'Shout'
                    with:
                        [ spec
                                className: 'ConfigurationOfShout';
                                loads: #('Core');
                                file: 'ConfigurationOfShout';
                                repository: 'http://www.squeaksource.com/MetacelloRepository' ];

c) the repositories i have specified for a particular package:
Example:

spec
                package: 'RoelTyper' with: [ spec repository: 'http://www.squeaksource.com/RoelTyper' ];
           

So...my question is...what does really overrerides that method?   which repositories?


Thanks

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: question about repositoryOverrides:

Dale Henrichs
Mariano,

#repositoryOverrides: is a message that you send to a version ... once
you've specified a repositoryOverride: the override carries over for all
loads that originate from the original load, so _all_ repositories
version, package, and project reference repositories.

#repositoryOverrides: is useful in the scenario where you have fetched
_all_ of the mcz files that you are using in your application and
stashed them in a local repository and then want to load using that
repository.

Dale

Mariano Martinez Peck wrote:

> Hi Dale. I am trying to understand repositoryOverrides: and I come to
> two questions that you may help me.
>
>  All the examples I saw for repositoryOverrides:   are done from a
> workspace, to load a version. Example:
>
> *| /localRepository/ /version/ |
> /localRepository/ :=
>
>
>     MCDirectoryRepository new
>         directory: (FileDirectory on: '/home/dhenrich/monticello').
>
>
> /version/ := ConfigurationOfMagritte project version: '1.2.1.3'.
> "set the repositoryOverrides"
>
>
> /version/ repositoryOverrides****: (Array with:****/ localRepository/********)**.**
>
>
> "do the load"
> /version/ load.*
>
>
>
> or:
>
>  | project version repo |
>  project := self project.
>  version := project version: '1.0'.
>  repo := MCDiDirectoryRepository new.
>  repo directory: FileDirectory on: '<path to directory>'.
>  version repositoryOverrides: (OrderedCollection with: repo).
>  version load.
>
>
> Now...this is only done from a workspace, but can I do this with a
> project reference?  Suppose the above code loads ConfigurationOfPharo.
> Ok, that mcz (ConfigurationOfPharo) will be download from the
> localRepository instead of MetacelloRepository. But, what happens with:
>
> a) the repositories I have specified in  self repository:  of
> ConfigurationOfPharo
> b) the repositories I have specified in a project reference. Example:
>
> project: 'Shout'
>                     with:
>                         [ spec
>                                 className: 'ConfigurationOfShout';
>                                 loads: #('Core');
>                                 file: 'ConfigurationOfShout';
>                                 repository:
> 'http://www.squeaksource.com/MetacelloRepository' ];
>
> c) the repositories i have specified for a particular package:
> Example:
>
> spec
>                 package: 'RoelTyper' with: [ spec repository:
> 'http://www.squeaksource.com/RoelTyper' ];
>            
>
> So...my question is...what does really overrerides that method?   which
> repositories?
>
>
> Thanks
>
> Mariano