Merge if newer versions available

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

Merge if newer versions available

Sean DeNigris
I have a project that holds all my build scripts/image customization,
so I always want each of my images to pick up the latest versions of
all the project's packages.

I want to use Metacello (and Gofer I guess?) to say: "for each package
in the project, if there is a newer version available, merge it in,
automatically if there are no conflicts."

I started with trying to figure out what my Configuration would load
(per http://groups.google.com/group/metacello/browse_thread/thread/96541afb72bf5478/570d1fb59029cf7d),
with both:
  ConfigurationOfDeNigrisSetup project bleedingEdge fetch
loadDirective
  (ConfigurationOfDeNigrisSetup project bleedingEdge fetch:
{'default'}) loadDirective
but they reported:
        linear load : 1.0-baseline [ConfigurationOfDeNigrisSetup]
even though the project version spec shows all the packages listed:
    spec blessing: #'baseline'.
    spec repository: '/path/to/Setup/'.
    spec
        package: 'DeNigrisSetup-Core';
        package: 'DeNigrisSetup-OB' with: [
                spec requires: #('DeNigrisSetup-Core' ). ];
        package: 'DeNigrisSetup-Core' with: [
                spec includes: #('DeNigrisSetup-Pharo14' ). ];
        package: 'DeNigrisSetup-Pharo14' with: [
                spec requires: #('DeNigrisSetup-Core' ). ].
    spec group: 'default' with: #('DeNigrisSetup-Core' ).

Why are they not listing the individual package versions?

Thanks.
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Dale Henrichs
The lookup in the repository occurs at actual load time ... the way you force "load latest version of package in repository" is to specify only the package name ...

Underneath the covers, metacello calls gofer and gofer decides which version to load ... at load time.

Does that answer your question?

----- Original Message -----
| From: "Sean DeNigris" <[hidden email]>
| To: "Metacello" <[hidden email]>
| Sent: Sunday, May 6, 2012 12:58:31 PM
| Subject: [Metacello] Merge if newer versions available
|
| I have a project that holds all my build scripts/image customization,
| so I always want each of my images to pick up the latest versions of
| all the project's packages.
|
| I want to use Metacello (and Gofer I guess?) to say: "for each
| package
| in the project, if there is a newer version available, merge it in,
| automatically if there are no conflicts."
|
| I started with trying to figure out what my Configuration would load
| (per
| http://groups.google.com/group/metacello/browse_thread/thread/96541afb72bf5478/570d1fb59029cf7d),
| with both:
|   ConfigurationOfDeNigrisSetup project bleedingEdge fetch
| loadDirective
|   (ConfigurationOfDeNigrisSetup project bleedingEdge fetch:
| {'default'}) loadDirective
| but they reported:
| linear load : 1.0-baseline [ConfigurationOfDeNigrisSetup]
| even though the project version spec shows all the packages listed:
|     spec blessing: #'baseline'.
|     spec repository: '/path/to/Setup/'.
|     spec
| package: 'DeNigrisSetup-Core';
| package: 'DeNigrisSetup-OB' with: [
| spec requires: #('DeNigrisSetup-Core' ). ];
| package: 'DeNigrisSetup-Core' with: [
| spec includes: #('DeNigrisSetup-Pharo14' ). ];
| package: 'DeNigrisSetup-Pharo14' with: [
| spec requires: #('DeNigrisSetup-Core' ). ].
|     spec group: 'default' with: #('DeNigrisSetup-Core' ).
|
| Why are they not listing the individual package versions?
|
| Thanks.
| Sean
|
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Sean DeNigris
the way you force "load latest version of package in repository" is to
specify only the package name

I only want to load the latest if the currently loaded packages are
ancestors of the latest and there are no unsaved changes. Otherwise,
if there are no conflicts, I want to merge them automatically. As a
last resort, if there are conflicts, I want to do a manual merge.

I thought that the first step would be to see what the latest package
versions actually were. I expected #loadDirective to give me something
like:
        package: 'DeNigrisSetup-Core-SeanDeNigris.32';
        package: 'DeNigrisSetup-OB-SeanDeNigris.12';
        package: 'DeNigrisSetup-Pharo14-SeanDeNigris.2'
as in http://groups.google.com/group/metacello/browse_thread/thread/8a9fce7fe0a7a4f6/
:
          ...
          load : DynamicBindings-lr.11
          load : KomServices-gc.19
          load : KomHttpServer-lr.51
          load : Seaside2.8a1-pmm.596
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Dale Henrichs
Sean,

The load directive with package versions gets produced when run against a version (not a baseline) where all of the package versions are explicitly specified ... the load directive lists the names of the packages _specified_. for a baseline, it's just the name of the package ...

I think that you can use the loadDirectives to figure out the latest package version in the repository is, but it doesn't work that way out of the box ....

Now that I think about it, you'll want to use fetch...fetch downloads the packages that are later than the ones loaded in the image and produces a set of load directives with the info you are looking for ...

Dale

----- Original Message -----
| From: "Sean DeNigris" <[hidden email]>
| To: "Metacello" <[hidden email]>
| Sent: Sunday, May 6, 2012 7:36:24 PM
| Subject: [Metacello] Re: Merge if newer versions available
|
| the way you force "load latest version of package in repository" is
| to
| specify only the package name
|
| I only want to load the latest if the currently loaded packages are
| ancestors of the latest and there are no unsaved changes. Otherwise,
| if there are no conflicts, I want to merge them automatically. As a
| last resort, if there are conflicts, I want to do a manual merge.
|
| I thought that the first step would be to see what the latest package
| versions actually were. I expected #loadDirective to give me
| something
| like:
|         package: 'DeNigrisSetup-Core-SeanDeNigris.32';
|         package: 'DeNigrisSetup-OB-SeanDeNigris.12';
|         package: 'DeNigrisSetup-Pharo14-SeanDeNigris.2'
| as in
| http://groups.google.com/group/metacello/browse_thread/thread/8a9fce7fe0a7a4f6/
| :
|           ...
|           load : DynamicBindings-lr.11
|           load : KomServices-gc.19
|           load : KomHttpServer-lr.51
|           load : Seaside2.8a1-pmm.596
|
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Sean DeNigris
On May 7, 1:50 am, Dale Henrichs <[hidden email]> wrote:
> Now that I think about it, you'll want to use fetch...fetch downloads the packages that are later than the ones loaded in the image and produces a set of load directives with the info you are looking for ...

Thanks, Dale. How do I use fetch for this?
"ConfigurationOfDeNigrisSetup project bleedingEdge fetch" was how I
got into this mess to begin with! ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Dale Henrichs
Then I must be wrong:) ...


Dale

----- Original Message -----
| From: "Sean DeNigris" <[hidden email]>
| To: "Metacello" <[hidden email]>
| Sent: Monday, May 7, 2012 1:00:54 PM
| Subject: [Metacello] Re: Merge if newer versions available
|
| On May 7, 1:50 am, Dale Henrichs <[hidden email]> wrote:
| > Now that I think about it, you'll want to use fetch...fetch
| > downloads the packages that are later than the ones loaded in the
| > image and produces a set of load directives with the info you are
| > looking for ...
|
| Thanks, Dale. How do I use fetch for this?
| "ConfigurationOfDeNigrisSetup project bleedingEdge fetch" was how I
| got into this mess to begin with! ;-)
|
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Dale Henrichs
Sean,

The sample you quoted where fetch "worked" was a version, where the package versions were specified and the load directive regurgitated the packageSpec ...

Sorry about that ... but wait ...

fetch doesn't give you the exact version, but it does identify which packages have newer versions ... if you fetch into a dictionary repository (#cacheRepository:), you'll have captured the latest versions of the packages, then you can then merge using the dictionary repository as the source ...

I seem to recall doing something along these lines for the MetacelloBrowser ...

Dale

----- Original Message -----
| From: "Dale Henrichs" <[hidden email]>
| To: [hidden email]
| Sent: Monday, May 7, 2012 2:08:49 PM
| Subject: Re: [Metacello] Re: Merge if newer versions available
|
| Then I must be wrong:) ...
|
|
| Dale
|
| ----- Original Message -----
| | From: "Sean DeNigris" <[hidden email]>
| | To: "Metacello" <[hidden email]>
| | Sent: Monday, May 7, 2012 1:00:54 PM
| | Subject: [Metacello] Re: Merge if newer versions available
| |
| | On May 7, 1:50 am, Dale Henrichs <[hidden email]> wrote:
| | > Now that I think about it, you'll want to use fetch...fetch
| | > downloads the packages that are later than the ones loaded in the
| | > image and produces a set of load directives with the info you are
| | > looking for ...
| |
| | Thanks, Dale. How do I use fetch for this?
| | "ConfigurationOfDeNigrisSetup project bleedingEdge fetch" was how I
| | got into this mess to begin with! ;-)
| |
|
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Sean DeNigris
In reply to this post by Sean DeNigris
On May 6, 3:58 pm, Sean DeNigris <[hidden email]> wrote:
>   ConfigurationOfDeNigrisSetup project bleedingEdge fetch
> loadDirective
> but they reported:
>         linear load : 1.0-baseline [ConfigurationOfDeNigrisSetup]
> even though the project version spec shows all the packages listed:

Omg, sorry, Dale! It was working the whole time, but my image already
had the latest versions loaded, so it was correctly reporting an empty
list. As soon as I committed a newer version of one of the packages,
it appeared in the fetch.

Now I just have to figure out the merge part...

Sean
Reply | Threaded
Open this post in threaded view
|

Re: Merge if newer versions available

Dale Henrichs
Sean,

Checkout MBUpdateDevCommand class in MetacelloBrowser-Commands package in http://www.squeaksource.com/MetacelloBrowser for a little merge action...

Dale

----- Original Message -----
| From: "Sean DeNigris" <[hidden email]>
| To: "Metacello" <[hidden email]>
| Sent: Monday, May 7, 2012 2:57:17 PM
| Subject: [Metacello] Re: Merge if newer versions available
|
| On May 6, 3:58 pm, Sean DeNigris <[hidden email]> wrote:
| >   ConfigurationOfDeNigrisSetup project bleedingEdge fetch
| > loadDirective
| > but they reported:
| >         linear load : 1.0-baseline [ConfigurationOfDeNigrisSetup]
| > even though the project version spec shows all the packages listed:
|
| Omg, sorry, Dale! It was working the whole time, but my image already
| had the latest versions loaded, so it was correctly reporting an
| empty
| list. As soon as I committed a newer version of one of the packages,
| it appeared in the fetch.
|
| Now I just have to figure out the merge part...
|
| Sean
|