Getting the list of dependent packages?

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

Getting the list of dependent packages?

Alexandre Bergel-5
Hi!

Consider the following baseline:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
baseline21: spec
        <version: '2.1-baseline'>
       
        spec for: #common do: [
                spec blessing: #baseline.
                spec repository: 'http://www.squeaksource.com/Mondrian'.

                spec project: 'HealthReportProducer' with: [
                                spec
                                        className: 'ConfigurationOfHealthReportProducer';
                                        file: 'ConfigurationOfHealthReportProducer';
                                        version: '1.0-beta.1';
                                        repository: 'http://www.squeaksource.com/MetacelloRepository' ].

                spec project: 'ProfStef' with: [
                                spec
                                        className: 'ConfigurationOfProfStef';
                                        file: 'ConfigurationOfProfStef';
                                        version: '1.3';
                                        repository: 'http://www.squeaksource.com/MetacelloRepository' ].

                spec
                        package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions' ];
  package: 'Mondrian-ComplexShape';
                        package: 'Mondrian-Core';
                        package: 'Mondrian-Layouts';
                        package: 'Mondrian-Help';
                        package: 'Mondrian-Easel';
                        package: 'Mondrian-Interaction';
                        package: 'Mondrian-Pharo-Tests';
                        package: 'Mondrian-Shapes';
                        package: 'Mondrian-Event';
                        package: 'Mondrian-Visitor';
                        package: 'Mondrian-Animation';
                        package: 'Mondrian-Util';
                        package: 'Mondrian-Normalizers';
                        package: 'Mondrian-Example';
                        package: 'Mondrian-Pharo-Morphic';
                        package: 'Mondrian-Tests'.

                spec group: 'Tests' with: #(
                                                'Mondrian-Tests'
                                                'Mondrian-Pharo-Tests'
                                                'CollectionExtensions')  ]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?

Something like this does not work:
-=-=-=-=-=-=-=-=-=-=-=-=
        versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
        self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
        versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
        versionConstructor root: versionSpec
-=-=-=-=-=-=-=-=-=-=-=-=

For fun, I tried:
-=-=-=-=-=-=-=-=-=-=-=-=
        possiblePackageNames :=
                ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
                        reject: [:l | l beginsWith: 'http']).
        packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
-=-=-=-=-=-=-=-=-=-=-=-=
It gives better results than using version constructor...

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Dale Henrichs
Alexandre,

Good question. If you inspect the following:

   (ConfigurationOfMetacello project version: '1.0-beta.27')
     record loadDirective

You'll get a MetacelloDirective structure that looks like this:

   linear load :
        linear load : 1.0-beta.27 [ConfigurationOfMetacello]
                load : ConfigurationOfGofer
        atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
                linear load : 1.0.2.1 [ConfigurationOfGofer]
                        load : Gofer-Core-dkh.121
                load : Metacello-Core-DaleHenrichs.363
                load : Metacello-MC-DaleHenrichs.415
                load : Metacello-Platform.pharo-DaleHenrichs.16

You can write code that looks like this that extracts a list of the mcz
file names:

        | packageNames |
        packageNames := OrderedCollection new.
        (ConfigurationOfMetacello project version: '1.0-beta.27')
                record loadDirective packageDirectivesDo: [:directive |
                        packageNames add: directive file ].
        packageNames

which produces:

    'ConfigurationOfGofer'
    'Gofer-Core-dkh.121'
    'Metacello-Core-DaleHenrichs.363'
    'Metacello-MC-DaleHenrichs.415'
    'Metacello-Platform.pharo-DaleHenrichs.16'

This works because a #version has explicit mcz file names embedded in
the spec. If the try the same trick on a #baseline, you'll get something
like the following:

   (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
     record loadDirective.

  linear load :
        linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
                load : ConfigurationOfGofer
        atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
                linear load : 1.0-baseline [ConfigurationOfGofer]
                        load : Gofer-Core
                load : Metacello-Core
                load : Metacello-MC
                load : Metacello-Platform.pharo

Which has no version numbers, to get those, we have to do a lookup in
the repository. For that you use #fetch instead of #record (and use
#ignoreImage:, so that you'll get the full list ... otherwise you'll end
up fetching only those mcz files that would be loaded in your image...
#record always ignores the image) and the following code:

        | packageNames version |
        packageNames := OrderedCollection new.
        version := ConfigurationOfMetacello project
                version: '1.0-beta.27-baseline'.
        version ignoreImage: true.
        version fetch loadDirective packageDirectivesDo: [:directive |
                packageNames add: directive file ].
        packageNames

which produces:

    'ConfigurationOfGofer-DaleHenrichs.13'
    'Gofer-Core-StephaneDucasse.127'
    'Metacello-Core-DaleHenrichs.373'
    'Metacello-MC-DaleHenrichs.431'
    'Metacello-Platform.pharo-DaleHenrichs.17'

Using MetacelloDirectives (from a #load, #fetch, or #record) is the
recommended way to programmatically analyze loads, since you are
guaranteed to use the exact same logic as the loader (the loader uses
the loadDirective to do the load).

Do something like the following:

   (ConfigurationOfMetacello project version: '1.0-beta.27') spec

to get at the versionSpec of a version.

Dale

On 10/28/2010 04:55 AM, Alexandre Bergel wrote:

> Hi!
>
> Consider the following baseline:
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> baseline21: spec
> <version: '2.1-baseline'>
>
> spec for: #common do: [
> spec blessing: #baseline.
> spec repository: 'http://www.squeaksource.com/Mondrian'.
>
> spec project: 'HealthReportProducer' with: [
> spec
> className: 'ConfigurationOfHealthReportProducer';
> file: 'ConfigurationOfHealthReportProducer';
> version: '1.0-beta.1';
> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>
> spec project: 'ProfStef' with: [
> spec
> className: 'ConfigurationOfProfStef';
> file: 'ConfigurationOfProfStef';
> version: '1.3';
> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>
> spec
> package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions' ];
>   package: 'Mondrian-ComplexShape';
> package: 'Mondrian-Core';
> package: 'Mondrian-Layouts';
> package: 'Mondrian-Help';
> package: 'Mondrian-Easel';
> package: 'Mondrian-Interaction';
> package: 'Mondrian-Pharo-Tests';
> package: 'Mondrian-Shapes';
> package: 'Mondrian-Event';
> package: 'Mondrian-Visitor';
> package: 'Mondrian-Animation';
> package: 'Mondrian-Util';
> package: 'Mondrian-Normalizers';
> package: 'Mondrian-Example';
> package: 'Mondrian-Pharo-Morphic';
> package: 'Mondrian-Tests'.
>
> spec group: 'Tests' with: #(
> 'Mondrian-Tests'
> 'Mondrian-Pharo-Tests'
> 'CollectionExtensions')  ]
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>
> Something like this does not work:
> -=-=-=-=-=-=-=-=-=-=-=-=
> versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
> self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
> versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
> versionConstructor root: versionSpec
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> For fun, I tried:
> -=-=-=-=-=-=-=-=-=-=-=-=
> possiblePackageNames :=
> ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
> reject: [:l | l beginsWith: 'http']).
> packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
> -=-=-=-=-=-=-=-=-=-=-=-=
> It gives better results than using version constructor...
>
> Cheers,
> Alexandre
>

Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Alexandre Bergel-5
Thanks Dale, it works fine!

Cheers,
Alexandre


On 28 Oct 2010, at 14:34, Dale Henrichs wrote:

> Alexandre,
>
> Good question. If you inspect the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27')
>    record loadDirective
>
> You'll get a MetacelloDirective structure that looks like this:
>
>  linear load :
> linear load : 1.0-beta.27 [ConfigurationOfMetacello]
> load : ConfigurationOfGofer
> atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
> linear load : 1.0.2.1 [ConfigurationOfGofer]
> load : Gofer-Core-dkh.121
> load : Metacello-Core-DaleHenrichs.363
> load : Metacello-MC-DaleHenrichs.415
> load : Metacello-Platform.pharo-DaleHenrichs.16
>
> You can write code that looks like this that extracts a list of the mcz file names:
>
> | packageNames |
> packageNames := OrderedCollection new.
> (ConfigurationOfMetacello project version: '1.0-beta.27')
> record loadDirective packageDirectivesDo: [:directive |
> packageNames add: directive file ].
> packageNames
>
> which produces:
>
>   'ConfigurationOfGofer'
>   'Gofer-Core-dkh.121'
>   'Metacello-Core-DaleHenrichs.363'
>   'Metacello-MC-DaleHenrichs.415'
>   'Metacello-Platform.pharo-DaleHenrichs.16'
>
> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>    record loadDirective.
>
> linear load :
> linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> load : ConfigurationOfGofer
> atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> linear load : 1.0-baseline [ConfigurationOfGofer]
> load : Gofer-Core
> load : Metacello-Core
> load : Metacello-MC
> load : Metacello-Platform.pharo
>
> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>
> | packageNames version |
> packageNames := OrderedCollection new.
> version := ConfigurationOfMetacello project
> version: '1.0-beta.27-baseline'.
> version ignoreImage: true.
> version fetch loadDirective packageDirectivesDo: [:directive |
> packageNames add: directive file ].
> packageNames
>
> which produces:
>
>   'ConfigurationOfGofer-DaleHenrichs.13'
>   'Gofer-Core-StephaneDucasse.127'
>   'Metacello-Core-DaleHenrichs.373'
>   'Metacello-MC-DaleHenrichs.431'
>   'Metacello-Platform.pharo-DaleHenrichs.17'
>
> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>
> Do something like the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>
> to get at the versionSpec of a version.
>
> Dale
>
> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>> Hi!
>>
>> Consider the following baseline:
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> baseline21: spec
>> <version: '2.1-baseline'>
>>
>> spec for: #common do: [
>> spec blessing: #baseline.
>> spec repository: 'http://www.squeaksource.com/Mondrian'.
>>
>> spec project: 'HealthReportProducer' with: [
>> spec
>> className: 'ConfigurationOfHealthReportProducer';
>> file: 'ConfigurationOfHealthReportProducer';
>> version: '1.0-beta.1';
>> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>>
>> spec project: 'ProfStef' with: [
>> spec
>> className: 'ConfigurationOfProfStef';
>> file: 'ConfigurationOfProfStef';
>> version: '1.3';
>> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>>
>> spec
>> package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions' ];
>>   package: 'Mondrian-ComplexShape';
>> package: 'Mondrian-Core';
>> package: 'Mondrian-Layouts';
>> package: 'Mondrian-Help';
>> package: 'Mondrian-Easel';
>> package: 'Mondrian-Interaction';
>> package: 'Mondrian-Pharo-Tests';
>> package: 'Mondrian-Shapes';
>> package: 'Mondrian-Event';
>> package: 'Mondrian-Visitor';
>> package: 'Mondrian-Animation';
>> package: 'Mondrian-Util';
>> package: 'Mondrian-Normalizers';
>> package: 'Mondrian-Example';
>> package: 'Mondrian-Pharo-Morphic';
>> package: 'Mondrian-Tests'.
>>
>> spec group: 'Tests' with: #(
>> 'Mondrian-Tests'
>> 'Mondrian-Pharo-Tests'
>> 'CollectionExtensions')  ]
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>
>> Something like this does not work:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>> self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>> versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>> versionConstructor root: versionSpec
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> For fun, I tried:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> possiblePackageNames :=
>> ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>> reject: [:l | l beginsWith: 'http']).
>> packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> It gives better results than using version constructor...
>>
>> Cheers,
>> Alexandre
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Alexandre Bergel-5
In reply to this post by Dale Henrichs
Hi Dale,

> | packageNames version |
> packageNames := OrderedCollection new.
> version := ConfigurationOfMetacello project
> version: '1.0-beta.27-baseline'.
> version ignoreImage: true.
> version fetch loadDirective packageDirectivesDo: [:directive |
> packageNames add: directive file ].
> packageNames

Your script has been quite useful until I tried to apply it to Moose.
For the version '1.0-beta.27-baseline', it gives all the packages version that are directly and _indirectly_ loaded by the version. Can I just get the one that are not loaded by dependent configurations? In Moose, we end up with more than 256 packages, which does not fit within one method. It also defeats the project dependency.

Cheers,
Alexandre


On 28 Oct 2010, at 14:34, Dale Henrichs wrote:

> Alexandre,
>
> Good question. If you inspect the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27')
>    record loadDirective
>
> You'll get a MetacelloDirective structure that looks like this:
>
>  linear load :
> linear load : 1.0-beta.27 [ConfigurationOfMetacello]
> load : ConfigurationOfGofer
> atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
> linear load : 1.0.2.1 [ConfigurationOfGofer]
> load : Gofer-Core-dkh.121
> load : Metacello-Core-DaleHenrichs.363
> load : Metacello-MC-DaleHenrichs.415
> load : Metacello-Platform.pharo-DaleHenrichs.16
>
> You can write code that looks like this that extracts a list of the mcz file names:
>
> | packageNames |
> packageNames := OrderedCollection new.
> (ConfigurationOfMetacello project version: '1.0-beta.27')
> record loadDirective packageDirectivesDo: [:directive |
> packageNames add: directive file ].
> packageNames
>
> which produces:
>
>   'ConfigurationOfGofer'
>   'Gofer-Core-dkh.121'
>   'Metacello-Core-DaleHenrichs.363'
>   'Metacello-MC-DaleHenrichs.415'
>   'Metacello-Platform.pharo-DaleHenrichs.16'
>
> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>    record loadDirective.
>
> linear load :
> linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> load : ConfigurationOfGofer
> atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> linear load : 1.0-baseline [ConfigurationOfGofer]
> load : Gofer-Core
> load : Metacello-Core
> load : Metacello-MC
> load : Metacello-Platform.pharo
>
> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>
> | packageNames version |
> packageNames := OrderedCollection new.
> version := ConfigurationOfMetacello project
> version: '1.0-beta.27-baseline'.
> version ignoreImage: true.
> version fetch loadDirective packageDirectivesDo: [:directive |
> packageNames add: directive file ].
> packageNames
>
> which produces:
>
>   'ConfigurationOfGofer-DaleHenrichs.13'
>   'Gofer-Core-StephaneDucasse.127'
>   'Metacello-Core-DaleHenrichs.373'
>   'Metacello-MC-DaleHenrichs.431'
>   'Metacello-Platform.pharo-DaleHenrichs.17'
>
> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>
> Do something like the following:
>
>  (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>
> to get at the versionSpec of a version.
>
> Dale
>
> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>> Hi!
>>
>> Consider the following baseline:
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> baseline21: spec
>> <version: '2.1-baseline'>
>>
>> spec for: #common do: [
>> spec blessing: #baseline.
>> spec repository: 'http://www.squeaksource.com/Mondrian'.
>>
>> spec project: 'HealthReportProducer' with: [
>> spec
>> className: 'ConfigurationOfHealthReportProducer';
>> file: 'ConfigurationOfHealthReportProducer';
>> version: '1.0-beta.1';
>> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>>
>> spec project: 'ProfStef' with: [
>> spec
>> className: 'ConfigurationOfProfStef';
>> file: 'ConfigurationOfProfStef';
>> version: '1.3';
>> repository: 'http://www.squeaksource.com/MetacelloRepository' ].
>>
>> spec
>> package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions' ];
>>   package: 'Mondrian-ComplexShape';
>> package: 'Mondrian-Core';
>> package: 'Mondrian-Layouts';
>> package: 'Mondrian-Help';
>> package: 'Mondrian-Easel';
>> package: 'Mondrian-Interaction';
>> package: 'Mondrian-Pharo-Tests';
>> package: 'Mondrian-Shapes';
>> package: 'Mondrian-Event';
>> package: 'Mondrian-Visitor';
>> package: 'Mondrian-Animation';
>> package: 'Mondrian-Util';
>> package: 'Mondrian-Normalizers';
>> package: 'Mondrian-Example';
>> package: 'Mondrian-Pharo-Morphic';
>> package: 'Mondrian-Tests'.
>>
>> spec group: 'Tests' with: #(
>> 'Mondrian-Tests'
>> 'Mondrian-Pharo-Tests'
>> 'CollectionExtensions')  ]
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>
>> Something like this does not work:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>> self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>> versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>> versionConstructor root: versionSpec
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> For fun, I tried:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> possiblePackageNames :=
>> ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>> reject: [:l | l beginsWith: 'http']).
>> packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> It gives better results than using version constructor...
>>
>> Cheers,
>> Alexandre
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Dale Henrichs
In reply to this post by Alexandre Bergel-5
Alexandre,

Take a look at the MetacelloToolBox class-side methods in 1.0-beta.28.
In the last several weeks I have done quite a bit of work for on
writing higher level scripts for automatically updating/creating
configurations.

When you first asked this question, I didn't realize your purpose for
the script and clearly answered a question that you were not asking:)

I suggest that you load 1.0-beta.28 and take a look at the scripts
that are provided. I also suggest that you look at the OB-Metacello
code, which has bee rewritten to use MetacelloToolBox ...

For generating a version method from a baseline use something like the
following script to generate a version method from a baseline:

  MetacelloToolBox
    createDevelopment: '4.2'
    for: 'Moose'
    importFromBaseline: '4.2-baseline'
    description: ''

Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
walkback...when I tried again to update Pharo1.2 image SqueakSource
went down, so I can't actually test this ...

What Pharo version is the target for loading the latest Moose
packages?

Dale


On Nov 4, 3:04 pm, Alexandre Bergel <[hidden email]> wrote:

> Thanks Dale, it works fine!
>
> Cheers,
> Alexandre
>
> On 28 Oct 2010, at 14:34, Dale Henrichs wrote:
>
>
>
> > Alexandre,
>
> > Good question. If you inspect the following:
>
> >  (ConfigurationOfMetacello project version: '1.0-beta.27')
> >    record loadDirective
>
> > You'll get a MetacelloDirective structure that looks like this:
>
> >  linear load :
> >    linear load : 1.0-beta.27 [ConfigurationOfMetacello]
> >            load : ConfigurationOfGofer
> >    atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
> >            linear load : 1.0.2.1 [ConfigurationOfGofer]
> >                    load : Gofer-Core-dkh.121
> >            load : Metacello-Core-DaleHenrichs.363
> >            load : Metacello-MC-DaleHenrichs.415
> >            load : Metacello-Platform.pharo-DaleHenrichs.16
>
> > You can write code that looks like this that extracts a list of the mcz file names:
>
> >    | packageNames |
> >    packageNames := OrderedCollection new.
> >    (ConfigurationOfMetacello project version: '1.0-beta.27')
> >            record loadDirective packageDirectivesDo: [:directive |
> >                    packageNames add: directive file ].
> >    packageNames
>
> > which produces:
>
> >   'ConfigurationOfGofer'
> >   'Gofer-Core-dkh.121'
> >   'Metacello-Core-DaleHenrichs.363'
> >   'Metacello-MC-DaleHenrichs.415'
> >   'Metacello-Platform.pharo-DaleHenrichs.16'
>
> > This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>
> >  (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
> >    record loadDirective.
>
> > linear load :
> >    linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> >            load : ConfigurationOfGofer
> >    atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
> >            linear load : 1.0-baseline [ConfigurationOfGofer]
> >                    load : Gofer-Core
> >            load : Metacello-Core
> >            load : Metacello-MC
> >            load : Metacello-Platform.pharo
>
> > Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>
> >    | packageNames version |
> >    packageNames := OrderedCollection new.
> >    version := ConfigurationOfMetacello project
> >            version: '1.0-beta.27-baseline'.
> >    version ignoreImage: true.
> >    version fetch loadDirective packageDirectivesDo: [:directive |
> >            packageNames add: directive file ].
> >    packageNames
>
> > which produces:
>
> >   'ConfigurationOfGofer-DaleHenrichs.13'
> >   'Gofer-Core-StephaneDucasse.127'
> >   'Metacello-Core-DaleHenrichs.373'
> >   'Metacello-MC-DaleHenrichs.431'
> >   'Metacello-Platform.pharo-DaleHenrichs.17'
>
> > Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>
> > Do something like the following:
>
> >  (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>
> > to get at the versionSpec of a version.
>
> > Dale
>
> > On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
> >> Hi!
>
> >> Consider the following baseline:
> >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >> baseline21: spec
> >>        <version: '2.1-baseline'>
>
> >>        spec for: #common do: [
> >>                spec blessing: #baseline.
> >>                spec repository: 'http://www.squeaksource.com/Mondrian'.
>
> >>                spec project: 'HealthReportProducer' with: [
> >>                                spec
> >>                                        className: 'ConfigurationOfHealthReportProducer';
> >>                                        file: 'ConfigurationOfHealthReportProducer';
> >>                                        version: '1.0-beta.1';
> >>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>
> >>                spec project: 'ProfStef' with: [
> >>                                spec
> >>                                        className: 'ConfigurationOfProfStef';
> >>                                        file: 'ConfigurationOfProfStef';
> >>                                        version: '1.3';
> >>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>
> >>                spec
> >>                        package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions'];
> >>                        package: 'Mondrian-ComplexShape';
> >>                        package: 'Mondrian-Core';
> >>                        package: 'Mondrian-Layouts';
> >>                        package: 'Mondrian-Help';
> >>                        package: 'Mondrian-Easel';
> >>                        package: 'Mondrian-Interaction';
> >>                        package: 'Mondrian-Pharo-Tests';
> >>                        package: 'Mondrian-Shapes';
> >>                        package: 'Mondrian-Event';
> >>                        package: 'Mondrian-Visitor';
> >>                        package: 'Mondrian-Animation';
> >>                        package: 'Mondrian-Util';
> >>                        package: 'Mondrian-Normalizers';
> >>                        package: 'Mondrian-Example';
> >>                        package: 'Mondrian-Pharo-Morphic';
> >>                        package: 'Mondrian-Tests'.
>
> >>                spec group: 'Tests' with: #(
> >>                                                'Mondrian-Tests'
> >>                                                'Mondrian-Pharo-Tests'
> >>                                                'CollectionExtensions')  ]
> >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> >> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>
> >> Something like this does not work:
> >> -=-=-=-=-=-=-=-=-=-=-=-=
> >>        versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
> >>        self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
> >>        versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
> >>        versionConstructor root: versionSpec
> >> -=-=-=-=-=-=-=-=-=-=-=-=
>
> >> For fun, I tried:
> >> -=-=-=-=-=-=-=-=-=-=-=-=
> >>        possiblePackageNames :=
> >>                ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
> >>                        reject: [:l | l beginsWith: 'http']).
> >>        packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
> >> -=-=-=-=-=-=-=-=-=-=-=-=
> >> It gives better results than using version constructor...
>
> >> Cheers,
> >> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Alexandre Bergel-5
Hi Dale,

Some questions:

- "ConfigurationOfMetacello loadLatestVersion" does not load Metacello-Core-DaleHenrichs.403
- where MetacelloBaseConfiguration can be found? I loaded the latest version, and the class is not present, which is apparently needed.

Cheers,
Alexandre


On 28 Nov 2010, at 19:25, Dale wrote:

> Alexandre,
>
> Take a look at the MetacelloToolBox class-side methods in 1.0-beta.28.
> In the last several weeks I have done quite a bit of work for on
> writing higher level scripts for automatically updating/creating
> configurations.
>
> When you first asked this question, I didn't realize your purpose for
> the script and clearly answered a question that you were not asking:)
>
> I suggest that you load 1.0-beta.28 and take a look at the scripts
> that are provided. I also suggest that you look at the OB-Metacello
> code, which has bee rewritten to use MetacelloToolBox ...
>
> For generating a version method from a baseline use something like the
> following script to generate a version method from a baseline:
>
>  MetacelloToolBox
>    createDevelopment: '4.2'
>    for: 'Moose'
>    importFromBaseline: '4.2-baseline'
>    description: ''
>
> Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
> walkback...when I tried again to update Pharo1.2 image SqueakSource
> went down, so I can't actually test this ...
>
> What Pharo version is the target for loading the latest Moose
> packages?
>
> Dale
>
>
> On Nov 4, 3:04 pm, Alexandre Bergel <[hidden email]> wrote:
>> Thanks Dale, it works fine!
>>
>> Cheers,
>> Alexandre
>>
>> On 28 Oct 2010, at 14:34, Dale Henrichs wrote:
>>
>>
>>
>>> Alexandre,
>>
>>> Good question. If you inspect the following:
>>
>>>  (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>    record loadDirective
>>
>>> You'll get a MetacelloDirective structure that looks like this:
>>
>>>  linear load :
>>>    linear load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>            load : ConfigurationOfGofer
>>>    atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>            linear load : 1.0.2.1 [ConfigurationOfGofer]
>>>                    load : Gofer-Core-dkh.121
>>>            load : Metacello-Core-DaleHenrichs.363
>>>            load : Metacello-MC-DaleHenrichs.415
>>>            load : Metacello-Platform.pharo-DaleHenrichs.16
>>
>>> You can write code that looks like this that extracts a list of the mcz file names:
>>
>>>    | packageNames |
>>>    packageNames := OrderedCollection new.
>>>    (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>            record loadDirective packageDirectivesDo: [:directive |
>>>                    packageNames add: directive file ].
>>>    packageNames
>>
>>> which produces:
>>
>>>   'ConfigurationOfGofer'
>>>   'Gofer-Core-dkh.121'
>>>   'Metacello-Core-DaleHenrichs.363'
>>>   'Metacello-MC-DaleHenrichs.415'
>>>   'Metacello-Platform.pharo-DaleHenrichs.16'
>>
>>> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>>
>>>  (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>>>    record loadDirective.
>>
>>> linear load :
>>>    linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>            load : ConfigurationOfGofer
>>>    atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>            linear load : 1.0-baseline [ConfigurationOfGofer]
>>>                    load : Gofer-Core
>>>            load : Metacello-Core
>>>            load : Metacello-MC
>>>            load : Metacello-Platform.pharo
>>
>>> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>>
>>>    | packageNames version |
>>>    packageNames := OrderedCollection new.
>>>    version := ConfigurationOfMetacello project
>>>            version: '1.0-beta.27-baseline'.
>>>    version ignoreImage: true.
>>>    version fetch loadDirective packageDirectivesDo: [:directive |
>>>            packageNames add: directive file ].
>>>    packageNames
>>
>>> which produces:
>>
>>>   'ConfigurationOfGofer-DaleHenrichs.13'
>>>   'Gofer-Core-StephaneDucasse.127'
>>>   'Metacello-Core-DaleHenrichs.373'
>>>   'Metacello-MC-DaleHenrichs.431'
>>>   'Metacello-Platform.pharo-DaleHenrichs.17'
>>
>>> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>>
>>> Do something like the following:
>>
>>>  (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>>
>>> to get at the versionSpec of a version.
>>
>>> Dale
>>
>>> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>>>> Hi!
>>
>>>> Consider the following baseline:
>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>> baseline21: spec
>>>>        <version: '2.1-baseline'>
>>
>>>>        spec for: #common do: [
>>>>                spec blessing: #baseline.
>>>>                spec repository: 'http://www.squeaksource.com/Mondrian'.
>>
>>>>                spec project: 'HealthReportProducer' with: [
>>>>                                spec
>>>>                                        className: 'ConfigurationOfHealthReportProducer';
>>>>                                        file: 'ConfigurationOfHealthReportProducer';
>>>>                                        version: '1.0-beta.1';
>>>>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>
>>>>                spec project: 'ProfStef' with: [
>>>>                                spec
>>>>                                        className: 'ConfigurationOfProfStef';
>>>>                                        file: 'ConfigurationOfProfStef';
>>>>                                        version: '1.3';
>>>>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>
>>>>                spec
>>>>                        package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions'];
>>>>                        package: 'Mondrian-ComplexShape';
>>>>                        package: 'Mondrian-Core';
>>>>                        package: 'Mondrian-Layouts';
>>>>                        package: 'Mondrian-Help';
>>>>                        package: 'Mondrian-Easel';
>>>>                        package: 'Mondrian-Interaction';
>>>>                        package: 'Mondrian-Pharo-Tests';
>>>>                        package: 'Mondrian-Shapes';
>>>>                        package: 'Mondrian-Event';
>>>>                        package: 'Mondrian-Visitor';
>>>>                        package: 'Mondrian-Animation';
>>>>                        package: 'Mondrian-Util';
>>>>                        package: 'Mondrian-Normalizers';
>>>>                        package: 'Mondrian-Example';
>>>>                        package: 'Mondrian-Pharo-Morphic';
>>>>                        package: 'Mondrian-Tests'.
>>
>>>>                spec group: 'Tests' with: #(
>>>>                                                'Mondrian-Tests'
>>>>                                                'Mondrian-Pharo-Tests'
>>>>                                                'CollectionExtensions')  ]
>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>>>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>
>>>> Something like this does not work:
>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>        versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>>>>        self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>>>>        versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>>>>        versionConstructor root: versionSpec
>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>>>> For fun, I tried:
>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>        possiblePackageNames :=
>>>>                ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>>>>                        reject: [:l | l beginsWith: 'http']).
>>>>        packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>> It gives better results than using version constructor...
>>
>>>> Cheers,
>>>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Dale Henrichs
Alexandre,

I'm not sure what you want with Metacello-Core-DaleHenrichs.403....

To get access to MetacelloBaseConfiguration, I'd suggest that you load
Metacello 1.0-beta.28:

   ConfigurationOfMetacello project updateProject.
   (ConfigurationOfMetacello project version: '1.0-beta.28') load.

Be aware that Metacello 1.0-beta.28 is under development so will be
changing over time. I recommend that you only use Metacello 1.0-beta.28
for experimental purposes, like looking and experimenting the the
toolbox scripts.

Also I am playing around with MetacelloBaseConfiguration and
MetacelloConfigTemplate so the current implementations aren't
necessarily representative of what will be in the release...

Dale

On 11/29/2010 09:34 AM, Alexandre Bergel wrote:

> Hi Dale,
>
> Some questions:
>
> - "ConfigurationOfMetacello loadLatestVersion" does not load Metacello-Core-DaleHenrichs.403
> - where MetacelloBaseConfiguration can be found? I loaded the latest version, and the class is not present, which is apparently needed.
>
> Cheers,
> Alexandre
>
>
> On 28 Nov 2010, at 19:25, Dale wrote:
>
>> Alexandre,
>>
>> Take a look at the MetacelloToolBox class-side methods in 1.0-beta.28.
>> In the last several weeks I have done quite a bit of work for on
>> writing higher level scripts for automatically updating/creating
>> configurations.
>>
>> When you first asked this question, I didn't realize your purpose for
>> the script and clearly answered a question that you were not asking:)
>>
>> I suggest that you load 1.0-beta.28 and take a look at the scripts
>> that are provided. I also suggest that you look at the OB-Metacello
>> code, which has bee rewritten to use MetacelloToolBox ...
>>
>> For generating a version method from a baseline use something like the
>> following script to generate a version method from a baseline:
>>
>>   MetacelloToolBox
>>     createDevelopment: '4.2'
>>     for: 'Moose'
>>     importFromBaseline: '4.2-baseline'
>>     description: ''
>>
>> Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
>> walkback...when I tried again to update Pharo1.2 image SqueakSource
>> went down, so I can't actually test this ...
>>
>> What Pharo version is the target for loading the latest Moose
>> packages?
>>
>> Dale
>>
>>
>> On Nov 4, 3:04 pm, Alexandre Bergel<[hidden email]>  wrote:
>>> Thanks Dale, it works fine!
>>>
>>> Cheers,
>>> Alexandre
>>>
>>> On 28 Oct 2010, at 14:34, Dale Henrichs wrote:
>>>
>>>
>>>
>>>> Alexandre,
>>>
>>>> Good question. If you inspect the following:
>>>
>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>     record loadDirective
>>>
>>>> You'll get a MetacelloDirective structure that looks like this:
>>>
>>>>   linear load :
>>>>     linear load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>             load : ConfigurationOfGofer
>>>>     atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>             linear load : 1.0.2.1 [ConfigurationOfGofer]
>>>>                     load : Gofer-Core-dkh.121
>>>>             load : Metacello-Core-DaleHenrichs.363
>>>>             load : Metacello-MC-DaleHenrichs.415
>>>>             load : Metacello-Platform.pharo-DaleHenrichs.16
>>>
>>>> You can write code that looks like this that extracts a list of the mcz file names:
>>>
>>>>     | packageNames |
>>>>     packageNames := OrderedCollection new.
>>>>     (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>             record loadDirective packageDirectivesDo: [:directive |
>>>>                     packageNames add: directive file ].
>>>>     packageNames
>>>
>>>> which produces:
>>>
>>>>    'ConfigurationOfGofer'
>>>>    'Gofer-Core-dkh.121'
>>>>    'Metacello-Core-DaleHenrichs.363'
>>>>    'Metacello-MC-DaleHenrichs.415'
>>>>    'Metacello-Platform.pharo-DaleHenrichs.16'
>>>
>>>> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>>>
>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>>>>     record loadDirective.
>>>
>>>> linear load :
>>>>     linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>             load : ConfigurationOfGofer
>>>>     atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>             linear load : 1.0-baseline [ConfigurationOfGofer]
>>>>                     load : Gofer-Core
>>>>             load : Metacello-Core
>>>>             load : Metacello-MC
>>>>             load : Metacello-Platform.pharo
>>>
>>>> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>>>
>>>>     | packageNames version |
>>>>     packageNames := OrderedCollection new.
>>>>     version := ConfigurationOfMetacello project
>>>>             version: '1.0-beta.27-baseline'.
>>>>     version ignoreImage: true.
>>>>     version fetch loadDirective packageDirectivesDo: [:directive |
>>>>             packageNames add: directive file ].
>>>>     packageNames
>>>
>>>> which produces:
>>>
>>>>    'ConfigurationOfGofer-DaleHenrichs.13'
>>>>    'Gofer-Core-StephaneDucasse.127'
>>>>    'Metacello-Core-DaleHenrichs.373'
>>>>    'Metacello-MC-DaleHenrichs.431'
>>>>    'Metacello-Platform.pharo-DaleHenrichs.17'
>>>
>>>> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>>>
>>>> Do something like the following:
>>>
>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>>>
>>>> to get at the versionSpec of a version.
>>>
>>>> Dale
>>>
>>>> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>>>>> Hi!
>>>
>>>>> Consider the following baseline:
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>> baseline21: spec
>>>>>         <version: '2.1-baseline'>
>>>
>>>>>         spec for: #common do: [
>>>>>                 spec blessing: #baseline.
>>>>>                 spec repository: 'http://www.squeaksource.com/Mondrian'.
>>>
>>>>>                 spec project: 'HealthReportProducer' with: [
>>>>>                                 spec
>>>>>                                         className: 'ConfigurationOfHealthReportProducer';
>>>>>                                         file: 'ConfigurationOfHealthReportProducer';
>>>>>                                         version: '1.0-beta.1';
>>>>>                                         repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>
>>>>>                 spec project: 'ProfStef' with: [
>>>>>                                 spec
>>>>>                                         className: 'ConfigurationOfProfStef';
>>>>>                                         file: 'ConfigurationOfProfStef';
>>>>>                                         version: '1.3';
>>>>>                                         repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>
>>>>>                 spec
>>>>>                         package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions'];
>>>>>                         package: 'Mondrian-ComplexShape';
>>>>>                         package: 'Mondrian-Core';
>>>>>                         package: 'Mondrian-Layouts';
>>>>>                         package: 'Mondrian-Help';
>>>>>                         package: 'Mondrian-Easel';
>>>>>                         package: 'Mondrian-Interaction';
>>>>>                         package: 'Mondrian-Pharo-Tests';
>>>>>                         package: 'Mondrian-Shapes';
>>>>>                         package: 'Mondrian-Event';
>>>>>                         package: 'Mondrian-Visitor';
>>>>>                         package: 'Mondrian-Animation';
>>>>>                         package: 'Mondrian-Util';
>>>>>                         package: 'Mondrian-Normalizers';
>>>>>                         package: 'Mondrian-Example';
>>>>>                         package: 'Mondrian-Pharo-Morphic';
>>>>>                         package: 'Mondrian-Tests'.
>>>
>>>>>                 spec group: 'Tests' with: #(
>>>>>                                                 'Mondrian-Tests'
>>>>>                                                 'Mondrian-Pharo-Tests'
>>>>>                                                 'CollectionExtensions')  ]
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>>>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>>
>>>>> Something like this does not work:
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>         versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>>>>>         self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>>>>>         versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>>>>>         versionConstructor root: versionSpec
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>>>> For fun, I tried:
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>         possiblePackageNames :=
>>>>>                 ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>>>>>                         reject: [:l | l beginsWith: 'http']).
>>>>>         packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>> It gives better results than using version constructor...
>>>
>>>>> Cheers,
>>>>> Alexandre
>>>
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Alexandre Bergel-5
Hi Dale,

When I evaluate:  MetacelloToolBox createDevelopment: '4.2' for: 'ConfigurationOfMoose' importFromBaseline: '4.2-baseline' description: 'generated by the toolbox'

I got the error: 'There are error issues with version ''4.2'''

Cheers,
Alexade

On 29 Nov 2010, at 16:39, Dale Henrichs wrote:

> Alexandre,
>
> I'm not sure what you want with Metacello-Core-DaleHenrichs.403....
>
> To get access to MetacelloBaseConfiguration, I'd suggest that you load Metacello 1.0-beta.28:
>
>  ConfigurationOfMetacello project updateProject.
>  (ConfigurationOfMetacello project version: '1.0-beta.28') load.
>
> Be aware that Metacello 1.0-beta.28 is under development so will be changing over time. I recommend that you only use Metacello 1.0-beta.28 for experimental purposes, like looking and experimenting the the toolbox scripts.
>
> Also I am playing around with MetacelloBaseConfiguration and MetacelloConfigTemplate so the current implementations aren't necessarily representative of what will be in the release...
>
> Dale
>
> On 11/29/2010 09:34 AM, Alexandre Bergel wrote:
>> Hi Dale,
>>
>> Some questions:
>>
>> - "ConfigurationOfMetacello loadLatestVersion" does not load Metacello-Core-DaleHenrichs.403
>> - where MetacelloBaseConfiguration can be found? I loaded the latest version, and the class is not present, which is apparently needed.
>>
>> Cheers,
>> Alexandre
>>
>>
>> On 28 Nov 2010, at 19:25, Dale wrote:
>>
>>> Alexandre,
>>>
>>> Take a look at the MetacelloToolBox class-side methods in 1.0-beta.28.
>>> In the last several weeks I have done quite a bit of work for on
>>> writing higher level scripts for automatically updating/creating
>>> configurations.
>>>
>>> When you first asked this question, I didn't realize your purpose for
>>> the script and clearly answered a question that you were not asking:)
>>>
>>> I suggest that you load 1.0-beta.28 and take a look at the scripts
>>> that are provided. I also suggest that you look at the OB-Metacello
>>> code, which has bee rewritten to use MetacelloToolBox ...
>>>
>>> For generating a version method from a baseline use something like the
>>> following script to generate a version method from a baseline:
>>>
>>>  MetacelloToolBox
>>>    createDevelopment: '4.2'
>>>    for: 'Moose'
>>>    importFromBaseline: '4.2-baseline'
>>>    description: ''
>>>
>>> Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
>>> walkback...when I tried again to update Pharo1.2 image SqueakSource
>>> went down, so I can't actually test this ...
>>>
>>> What Pharo version is the target for loading the latest Moose
>>> packages?
>>>
>>> Dale
>>>
>>>
>>> On Nov 4, 3:04 pm, Alexandre Bergel<[hidden email]>  wrote:
>>>> Thanks Dale, it works fine!
>>>>
>>>> Cheers,
>>>> Alexandre
>>>>
>>>> On 28 Oct 2010, at 14:34, Dale Henrichs wrote:
>>>>
>>>>
>>>>
>>>>> Alexandre,
>>>>
>>>>> Good question. If you inspect the following:
>>>>
>>>>>  (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>>    record loadDirective
>>>>
>>>>> You'll get a MetacelloDirective structure that looks like this:
>>>>
>>>>>  linear load :
>>>>>    linear load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>>            load : ConfigurationOfGofer
>>>>>    atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>>            linear load : 1.0.2.1 [ConfigurationOfGofer]
>>>>>                    load : Gofer-Core-dkh.121
>>>>>            load : Metacello-Core-DaleHenrichs.363
>>>>>            load : Metacello-MC-DaleHenrichs.415
>>>>>            load : Metacello-Platform.pharo-DaleHenrichs.16
>>>>
>>>>> You can write code that looks like this that extracts a list of the mcz file names:
>>>>
>>>>>    | packageNames |
>>>>>    packageNames := OrderedCollection new.
>>>>>    (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>>            record loadDirective packageDirectivesDo: [:directive |
>>>>>                    packageNames add: directive file ].
>>>>>    packageNames
>>>>
>>>>> which produces:
>>>>
>>>>>   'ConfigurationOfGofer'
>>>>>   'Gofer-Core-dkh.121'
>>>>>   'Metacello-Core-DaleHenrichs.363'
>>>>>   'Metacello-MC-DaleHenrichs.415'
>>>>>   'Metacello-Platform.pharo-DaleHenrichs.16'
>>>>
>>>>> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>>>>
>>>>>  (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>>>>>    record loadDirective.
>>>>
>>>>> linear load :
>>>>>    linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>>            load : ConfigurationOfGofer
>>>>>    atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>>            linear load : 1.0-baseline [ConfigurationOfGofer]
>>>>>                    load : Gofer-Core
>>>>>            load : Metacello-Core
>>>>>            load : Metacello-MC
>>>>>            load : Metacello-Platform.pharo
>>>>
>>>>> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>>>>
>>>>>    | packageNames version |
>>>>>    packageNames := OrderedCollection new.
>>>>>    version := ConfigurationOfMetacello project
>>>>>            version: '1.0-beta.27-baseline'.
>>>>>    version ignoreImage: true.
>>>>>    version fetch loadDirective packageDirectivesDo: [:directive |
>>>>>            packageNames add: directive file ].
>>>>>    packageNames
>>>>
>>>>> which produces:
>>>>
>>>>>   'ConfigurationOfGofer-DaleHenrichs.13'
>>>>>   'Gofer-Core-StephaneDucasse.127'
>>>>>   'Metacello-Core-DaleHenrichs.373'
>>>>>   'Metacello-MC-DaleHenrichs.431'
>>>>>   'Metacello-Platform.pharo-DaleHenrichs.17'
>>>>
>>>>> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>>>>
>>>>> Do something like the following:
>>>>
>>>>>  (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>>>>
>>>>> to get at the versionSpec of a version.
>>>>
>>>>> Dale
>>>>
>>>>> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>>>>>> Hi!
>>>>
>>>>>> Consider the following baseline:
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>>> baseline21: spec
>>>>>>        <version: '2.1-baseline'>
>>>>
>>>>>>        spec for: #common do: [
>>>>>>                spec blessing: #baseline.
>>>>>>                spec repository: 'http://www.squeaksource.com/Mondrian'.
>>>>
>>>>>>                spec project: 'HealthReportProducer' with: [
>>>>>>                                spec
>>>>>>                                        className: 'ConfigurationOfHealthReportProducer';
>>>>>>                                        file: 'ConfigurationOfHealthReportProducer';
>>>>>>                                        version: '1.0-beta.1';
>>>>>>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>>
>>>>>>                spec project: 'ProfStef' with: [
>>>>>>                                spec
>>>>>>                                        className: 'ConfigurationOfProfStef';
>>>>>>                                        file: 'ConfigurationOfProfStef';
>>>>>>                                        version: '1.3';
>>>>>>                                        repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>>
>>>>>>                spec
>>>>>>                        package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions'];
>>>>>>                        package: 'Mondrian-ComplexShape';
>>>>>>                        package: 'Mondrian-Core';
>>>>>>                        package: 'Mondrian-Layouts';
>>>>>>                        package: 'Mondrian-Help';
>>>>>>                        package: 'Mondrian-Easel';
>>>>>>                        package: 'Mondrian-Interaction';
>>>>>>                        package: 'Mondrian-Pharo-Tests';
>>>>>>                        package: 'Mondrian-Shapes';
>>>>>>                        package: 'Mondrian-Event';
>>>>>>                        package: 'Mondrian-Visitor';
>>>>>>                        package: 'Mondrian-Animation';
>>>>>>                        package: 'Mondrian-Util';
>>>>>>                        package: 'Mondrian-Normalizers';
>>>>>>                        package: 'Mondrian-Example';
>>>>>>                        package: 'Mondrian-Pharo-Morphic';
>>>>>>                        package: 'Mondrian-Tests'.
>>>>
>>>>>>                spec group: 'Tests' with: #(
>>>>>>                                                'Mondrian-Tests'
>>>>>>                                                'Mondrian-Pharo-Tests'
>>>>>>                                                'CollectionExtensions')  ]
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>
>>>>>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>>>
>>>>>> Something like this does not work:
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>        versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>>>>>>        self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>>>>>>        versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>>>>>>        versionConstructor root: versionSpec
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>
>>>>>> For fun, I tried:
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>        possiblePackageNames :=
>>>>>>                ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>>>>>>                        reject: [:l | l beginsWith: 'http']).
>>>>>>        packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>> It gives better results than using version constructor...
>>>>
>>>>>> Cheers,
>>>>>> Alexandre
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel  http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Alexandre Bergel-5
In reply to this post by Dale Henrichs
> MetacelloToolBox
>    createDevelopment: '4.2'
>    for: 'Moose'
>    importFromBaseline: '4.2-baseline'
>    description: ''

This is exactly what I need

> Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
> walkback...when I tried again to update Pharo1.2 image SqueakSource
> went down, so I can't actually test this ...
>
> What Pharo version is the target for loading the latest Moose
> packages?


Version 4.2 of Moose is meant of work on a Pharo 1.1.1
I think the only difference between Version 4.2 and the last version of Moose is the version of Shout to load. We need to load Version 1.1 of Shout on Pharo 1.1.1 and Version 1.2 of Shout in Pharo 1.2

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Dale Henrichs
In reply to this post by Alexandre Bergel-5
If you open the debugger, you will be able to inspect the list of issues
that caused the error ...

You can also do the following:

   (MetacelloToolBox
     validateConfiguration: ConfigurationOfMoose
     debug: #()
     recurse: false) explore

To explore the list of issues that a particular configuration has,
before automatically generating the method

For the most recent version I get the following validation issues:

   1.  Error: Cannot resolve version '1.0-beta.1' for the project
         reference 'PetitParser for Moose' in version '4.0'
         { cannotResolveVersion }
   2. Error: No explicit version specified for the package 'Famix-C' in
         version '4.2' for symbolic version #development
         { noVersionForSymbolicVersion }

The first issue is for version 4.0 of Moose so isn't directly related to
your issue.

The second issue is the source of your error, since it refers to Moose
4.2 for which you are generating the method. If you look for 'Famix-C'
in the version method you'll see the following line:

   package: 'Famix-C' with: 'Famix-C';

In a version method, the explicit mcz file version should be supplied
like it is for 'Famix-Core':

   package: 'Famix-Core' with: 'Famix-Core-cyrille_delaunay.123';

In retrospect the issue message is not quite right and I'll fix that in
a subsequent version, however, the error is a real one ... It was
probably caused by the fact that the package 'Famix-C' wasn't loaded
into your image for some reason...

Dale

On 11/30/2010 04:31 AM, Alexandre Bergel wrote:

> Hi Dale,
>
> When I evaluate:  MetacelloToolBox createDevelopment: '4.2' for: 'ConfigurationOfMoose' importFromBaseline: '4.2-baseline' description: 'generated by the toolbox'
>
> I got the error: 'There are error issues with version ''4.2'''
>
> Cheers,
> Alexade
>
> On 29 Nov 2010, at 16:39, Dale Henrichs wrote:
>
>> Alexandre,
>>
>> I'm not sure what you want with Metacello-Core-DaleHenrichs.403....
>>
>> To get access to MetacelloBaseConfiguration, I'd suggest that you load Metacello 1.0-beta.28:
>>
>>   ConfigurationOfMetacello project updateProject.
>>   (ConfigurationOfMetacello project version: '1.0-beta.28') load.
>>
>> Be aware that Metacello 1.0-beta.28 is under development so will be changing over time. I recommend that you only use Metacello 1.0-beta.28 for experimental purposes, like looking and experimenting the the toolbox scripts.
>>
>> Also I am playing around with MetacelloBaseConfiguration and MetacelloConfigTemplate so the current implementations aren't necessarily representative of what will be in the release...
>>
>> Dale
>>
>> On 11/29/2010 09:34 AM, Alexandre Bergel wrote:
>>> Hi Dale,
>>>
>>> Some questions:
>>>
>>> - "ConfigurationOfMetacello loadLatestVersion" does not load Metacello-Core-DaleHenrichs.403
>>> - where MetacelloBaseConfiguration can be found? I loaded the latest version, and the class is not present, which is apparently needed.
>>>
>>> Cheers,
>>> Alexandre
>>>
>>>
>>> On 28 Nov 2010, at 19:25, Dale wrote:
>>>
>>>> Alexandre,
>>>>
>>>> Take a look at the MetacelloToolBox class-side methods in 1.0-beta.28.
>>>> In the last several weeks I have done quite a bit of work for on
>>>> writing higher level scripts for automatically updating/creating
>>>> configurations.
>>>>
>>>> When you first asked this question, I didn't realize your purpose for
>>>> the script and clearly answered a question that you were not asking:)
>>>>
>>>> I suggest that you load 1.0-beta.28 and take a look at the scripts
>>>> that are provided. I also suggest that you look at the OB-Metacello
>>>> code, which has bee rewritten to use MetacelloToolBox ...
>>>>
>>>> For generating a version method from a baseline use something like the
>>>> following script to generate a version method from a baseline:
>>>>
>>>>   MetacelloToolBox
>>>>     createDevelopment: '4.2'
>>>>     for: 'Moose'
>>>>     importFromBaseline: '4.2-baseline'
>>>>     description: ''
>>>>
>>>> Note that I tried to load the latest Moose into Pharo 1.1.1 and got a
>>>> walkback...when I tried again to update Pharo1.2 image SqueakSource
>>>> went down, so I can't actually test this ...
>>>>
>>>> What Pharo version is the target for loading the latest Moose
>>>> packages?
>>>>
>>>> Dale
>>>>
>>>>
>>>> On Nov 4, 3:04 pm, Alexandre Bergel<[hidden email]>   wrote:
>>>>> Thanks Dale, it works fine!
>>>>>
>>>>> Cheers,
>>>>> Alexandre
>>>>>
>>>>> On 28 Oct 2010, at 14:34, Dale Henrichs wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Alexandre,
>>>>>
>>>>>> Good question. If you inspect the following:
>>>>>
>>>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>>>     record loadDirective
>>>>>
>>>>>> You'll get a MetacelloDirective structure that looks like this:
>>>>>
>>>>>>   linear load :
>>>>>>     linear load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>>>             load : ConfigurationOfGofer
>>>>>>     atomic load : 1.0-beta.27 [ConfigurationOfMetacello]
>>>>>>             linear load : 1.0.2.1 [ConfigurationOfGofer]
>>>>>>                     load : Gofer-Core-dkh.121
>>>>>>             load : Metacello-Core-DaleHenrichs.363
>>>>>>             load : Metacello-MC-DaleHenrichs.415
>>>>>>             load : Metacello-Platform.pharo-DaleHenrichs.16
>>>>>
>>>>>> You can write code that looks like this that extracts a list of the mcz file names:
>>>>>
>>>>>>     | packageNames |
>>>>>>     packageNames := OrderedCollection new.
>>>>>>     (ConfigurationOfMetacello project version: '1.0-beta.27')
>>>>>>             record loadDirective packageDirectivesDo: [:directive |
>>>>>>                     packageNames add: directive file ].
>>>>>>     packageNames
>>>>>
>>>>>> which produces:
>>>>>
>>>>>>    'ConfigurationOfGofer'
>>>>>>    'Gofer-Core-dkh.121'
>>>>>>    'Metacello-Core-DaleHenrichs.363'
>>>>>>    'Metacello-MC-DaleHenrichs.415'
>>>>>>    'Metacello-Platform.pharo-DaleHenrichs.16'
>>>>>
>>>>>> This works because a #version has explicit mcz file names embedded in the spec. If the try the same trick on a #baseline, you'll get something like the following:
>>>>>
>>>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27-baseline')
>>>>>>     record loadDirective.
>>>>>
>>>>>> linear load :
>>>>>>     linear load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>>>             load : ConfigurationOfGofer
>>>>>>     atomic load : 1.0-beta.27-baseline [ConfigurationOfMetacello]
>>>>>>             linear load : 1.0-baseline [ConfigurationOfGofer]
>>>>>>                     load : Gofer-Core
>>>>>>             load : Metacello-Core
>>>>>>             load : Metacello-MC
>>>>>>             load : Metacello-Platform.pharo
>>>>>
>>>>>> Which has no version numbers, to get those, we have to do a lookup in the repository. For that you use #fetch instead of #record (and use #ignoreImage:, so that you'll get the full list ... otherwise you'll end up fetching only those mcz files that would be loaded in your image... #record always ignores the image) and the following code:
>>>>>
>>>>>>     | packageNames version |
>>>>>>     packageNames := OrderedCollection new.
>>>>>>     version := ConfigurationOfMetacello project
>>>>>>             version: '1.0-beta.27-baseline'.
>>>>>>     version ignoreImage: true.
>>>>>>     version fetch loadDirective packageDirectivesDo: [:directive |
>>>>>>             packageNames add: directive file ].
>>>>>>     packageNames
>>>>>
>>>>>> which produces:
>>>>>
>>>>>>    'ConfigurationOfGofer-DaleHenrichs.13'
>>>>>>    'Gofer-Core-StephaneDucasse.127'
>>>>>>    'Metacello-Core-DaleHenrichs.373'
>>>>>>    'Metacello-MC-DaleHenrichs.431'
>>>>>>    'Metacello-Platform.pharo-DaleHenrichs.17'
>>>>>
>>>>>> Using MetacelloDirectives (from a #load, #fetch, or #record) is the recommended way to programmatically analyze loads, since you are guaranteed to use the exact same logic as the loader (the loader uses the loadDirective to do the load).
>>>>>
>>>>>> Do something like the following:
>>>>>
>>>>>>   (ConfigurationOfMetacello project version: '1.0-beta.27') spec
>>>>>
>>>>>> to get at the versionSpec of a version.
>>>>>
>>>>>> Dale
>>>>>
>>>>>> On 10/28/2010 04:55 AM, Alexandre Bergel wrote:
>>>>>>> Hi!
>>>>>
>>>>>>> Consider the following baseline:
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>> baseline21: spec
>>>>>>>         <version: '2.1-baseline'>
>>>>>
>>>>>>>         spec for: #common do: [
>>>>>>>                 spec blessing: #baseline.
>>>>>>>                 spec repository: 'http://www.squeaksource.com/Mondrian'.
>>>>>
>>>>>>>                 spec project: 'HealthReportProducer' with: [
>>>>>>>                                 spec
>>>>>>>                                         className: 'ConfigurationOfHealthReportProducer';
>>>>>>>                                         file: 'ConfigurationOfHealthReportProducer';
>>>>>>>                                         version: '1.0-beta.1';
>>>>>>>                                         repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>>>
>>>>>>>                 spec project: 'ProfStef' with: [
>>>>>>>                                 spec
>>>>>>>                                         className: 'ConfigurationOfProfStef';
>>>>>>>                                         file: 'ConfigurationOfProfStef';
>>>>>>>                                         version: '1.3';
>>>>>>>                                         repository: 'http://www.squeaksource.com/MetacelloRepository'].
>>>>>
>>>>>>>                 spec
>>>>>>>                         package: 'CollectionExtensions' with: [ spec repository: 'http://www.squeaksource.com/CollectionExtensions'];
>>>>>>>                         package: 'Mondrian-ComplexShape';
>>>>>>>                         package: 'Mondrian-Core';
>>>>>>>                         package: 'Mondrian-Layouts';
>>>>>>>                         package: 'Mondrian-Help';
>>>>>>>                         package: 'Mondrian-Easel';
>>>>>>>                         package: 'Mondrian-Interaction';
>>>>>>>                         package: 'Mondrian-Pharo-Tests';
>>>>>>>                         package: 'Mondrian-Shapes';
>>>>>>>                         package: 'Mondrian-Event';
>>>>>>>                         package: 'Mondrian-Visitor';
>>>>>>>                         package: 'Mondrian-Animation';
>>>>>>>                         package: 'Mondrian-Util';
>>>>>>>                         package: 'Mondrian-Normalizers';
>>>>>>>                         package: 'Mondrian-Example';
>>>>>>>                         package: 'Mondrian-Pharo-Morphic';
>>>>>>>                         package: 'Mondrian-Tests'.
>>>>>
>>>>>>>                 spec group: 'Tests' with: #(
>>>>>>>                                                 'Mondrian-Tests'
>>>>>>>                                                 'Mondrian-Pharo-Tests'
>>>>>>>                                                 'CollectionExtensions')  ]
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>>
>>>>>>> How can I, programmatically, know the packages that I need to provide in the version that use this baseline ?
>>>>>
>>>>>>> Something like this does not work:
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>>         versionConstructor := (Smalltalk at: #MetacelloVersionConstructor) new.
>>>>>>>         self configurationClass new perform: lastBaseLineMethod selector with: versionConstructor.
>>>>>>>         versionSpec := (Smalltalk at: #MetacelloVersionSpec) new.
>>>>>>>         versionConstructor root: versionSpec
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>
>>>>>>> For fun, I tried:
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>>         possiblePackageNames :=
>>>>>>>                 ((lastBaseLineMethod literals select: [ :l | l class == ByteString ])
>>>>>>>                         reject: [:l | l beginsWith: 'http']).
>>>>>>>         packageInfos := PackageInfo allPackages select: [ :pi | possiblePackageNames includes: pi packageName ].
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>>>>> It gives better results than using version constructor...
>>>>>
>>>>>>> Cheers,
>>>>>>> Alexandre
>>>>>
>>>>> --
>>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>> Alexandre Bergel  http://www.bergel.eu
>>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>>
>>>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting the list of dependent packages?

Dale Henrichs
In reply to this post by Alexandre Bergel-5

On 11/30/2010 04:33 AM, Alexandre Bergel wrote:
>> MetacelloToolBox createDevelopment: '4.2' for: 'Moose'
>> importFromBaseline: '4.2-baseline' description: ''
>
> This is exactly what I need

Good!

>
>> Note that I tried to load the latest Moose into Pharo 1.1.1 and got
>> a walkback...when I tried again to update Pharo1.2 image
>> SqueakSource went down, so I can't actually test this ...
>>
>> What Pharo version is the target for loading the latest Moose
>> packages?
>
>
> Version 4.2 of Moose is meant of work on a Pharo 1.1.1 I think the
> only difference between Version 4.2 and the last version of Moose is
> the version of Shout to load. We need to load Version 1.1 of Shout on
> Pharo 1.1.1 and Version 1.2 of Shout in Pharo 1.2

How do you want to handle this for the near term?

In the long term, you should use symbolic versions for this.

In the short term, we can control which version of Shout is loaded by
creating a project-specific attribute that differentiates between
Pharo1.1.1 and Pharo1.2.

A third option is for me to make another early access release of
Metacello (for stability purposes) that should be used by folks wanting
to load Moose4.2.

I guess a fourth option is to wait till symbolic versions are ready.
Converting Moose and friends like I did for OmniBrowser is part of my
pre-release plans for 1.0-beta.28 ...

Dale