Login  Register

Re: collecting all packages of a configuration

Posted by Mariano Martinez Peck on Dec 04, 2011; 12:27am
URL: https://forum.world.st/collecting-all-packages-of-a-configuration-tp4079913p4155539.html



On Thu, Nov 17, 2011 at 6:57 PM, Dale Henrichs <[hidden email]> wrote:
Jannik,

There are two routes you can take to answer your question. Firstly, you can directly query the version itself:

 ((ConfigurationOfMetacello project currentVersion) allPackagesForSpecNamed: 'ALL')
   collect: [:spec | spec file ].

Or you can use #record: and then collect the information you want:

 | pkgs loader |
 loader := (ConfigurationOfMetacello project currentVersion)
       ignoreImage: true;
       record: 'ALL'.
 pkgs := OrderedCollection new.
 loader loadDirective packageDirectivesDo: [:directive |pkgs add: directive spec file ].
 pkgs.


Hi Dale. I have notice that both ways are different. For example, the first one does not take into account those ConfigurationOfXXX packages, whereas the second one does. Moreoever, in the second one, I see that there are repetitions. For example:

 | pkgs loader |
 loader := ((Smalltalk at: #ConfigurationOfSeaside30) project version: '3.0.6.3')
       ignoreImage: true;
       record: #('Core' 'Tests' 'Zinc-Seaside' ).
 pkgs := OrderedCollection new.
 loader loadDirective packageDirectivesDo: [:directive |pkgs add: directive spec file ].
 pkgs.

size gives me 127, but asSet size, 106. It seems some packages appear more than once like ConfigurationOfGrease.

ConfigurationOfXXX do not have version number in their name, but the rest do have.

Now, the main problem is that none of them is what I need: I need ALL the required packages that are needed to load such project with metacello. I want to capture the exact list of packages needed when I do, for example:
    ((Smalltalk at: #ConfigurationOfSeaside30) project version: '3.0.6.3')
    load: #('Core' 'Tests' 'Zinc-Seaside' ).

The first one doesn't even take into account ConfigurationOfXX, so it doesn't help me. The second one, not only has repetitions, but also it lists packages that I really don't need. For example, OB-Morphic-lr.164 and Seaside-Tools-OmniBrowser-lr.25. I don't understand how those packages arrived to the list. If I take a clean image, and install Seaside with the way I showed you, those packages are not even downloaded. So why do they appear here?

So...all in all, what I need is a list of the exact packages I need to reproduce something I have loaded with Metacello. In other words, if I start an image with an empty package-cache, and execute the load of seaside, how can I know the list of packages that were downloaded?  of course, not inspecting the package-cache ;)

Thanks in advance Dale!!!


 
Dale

----- Original Message -----
| From: "jannik.laval" <[hidden email]>
| To: [hidden email]
| Sent: Thursday, November 17, 2011 5:11:09 AM
| Subject: [Metacello] collecting all packages of a configuration
|
|
|
|
|
| Hi guys,
|
|
| With mariano, we had a discussion about a problem I have:
| How can I collect all packages from a configuration with resolving
| all sub projects ?
|
|
| Thank you for your help.
| Cheers,
| Jannik
|
|
|
| Begin forwarded message:
|
|
|
| From: Mariano Martinez Peck < [hidden email] >
|
| Subject: Re: Metacello question
|
| Date: November 16, 2011 4:09:38 PM GMT+01:00
|
| To: "jannik.laval" < [hidden email] >
|
|
|
|
| On Wed, Nov 16, 2011 at 11:57 AM, jannik.laval <
| [hidden email] > wrote:
|
|
|
|
| Hi Mariano,
|
|
| I understand your code and It seems to be the same as mine.
| version40 make the same as "project version: '4.0'".
|
|
| The problem is the resolution of internal projects.
| We should collect the methods recursively... and possibly with
| circular dependencies.
| So, Metacello can resolve them, but I do not know Metacello :(
|
|
|
|
| I have no idea :(
| Ask in metacello mailing list: [hidden email] ,
|
| good luck
|
|
|
|
|
| Jannik
|
|
|
|
|
|
| On Nov 16, 2011, at 15:36 , Mariano Martinez Peck wrote:
|
|
|
|
|
| On Wed, Nov 16, 2011 at 6:59 AM, jannik.laval <
| [hidden email] > wrote:
|
|
| Hi Mariano,
| How are you ?
| Here, at Bordeaux, I am fine, and all the family too :)
|
|
|
| Excellent, nice to hear that :)
| I am in Argentina in holidays (after Smalltalks) and all familiy good
| as well hahahahah
|
|
|
| I have a question about Metacello, and you know well Metacello :)
| I would like to collect all the files to load of a Configuration with
| all dependencies already resolved.
|
| For now, I have this code in a transcript:
| ===
| ConfigurationOfMoose version40 spec packages map select:[:e | e
| isKindOf: MetacelloPackageSpec ]
| thenCollect: [:e | e repositories list isEmpty
| ifTrue: [e file]
| ifFalse: [e repositories list first name, '/' , e file]].
| ===
| It allows me to have all files in ConfigurationOfMoose, but I have
| two problems:
|
| - if I change version40 by version42, I have no more the name of
| packages.
| Here is an example:
| with version40, the first value of my collection is: '
| http://www.squeaksource.com/Arki/Arki-Reporter-tg.3 '
| with version42, it is: '
| http://www.squeaksource.com/Arki/Arki-Reporter-Browser '
| ==> I have no more the versions to load.
|
|
|
| (ConfigurationOfMoose project version: '4.0') packages collect: [
| :each | each name ] as: Set.
|
| or ..
|
| (ConfigurationOfMoose project version: '4.2') packages collect: [
| :each | each name ] as: Set.
|
| does that help ?
|
|
|
| - the second problem is about depending project. Moose load other
| projects, and there are some cyclic dependencies between the loads:
| for example DSM needs Moose, and Moose loads DSM.....
| I know that Metacello resolves this kind of problems.
|
| So, my question is: is it possible to obtain a list of all packages
| of a configuration ?
|
| Thank you
| ---
| Jannik Laval
|
|
|
|
| --
| Mariano
| http://marianopeck.wordpress.com
|
|
|
|
|
|
|
|
|
| ---
| Jannik Laval
|
|
|
| --
| Mariano
| http://marianopeck.wordpress.com
|
|
|
|
|
|
|
|
|
| ---
| Jannik Laval
|
|
|
|
|
|
|
|
| ---
| Jannik Laval
|



--
Mariano
http://marianopeck.wordpress.com