1

I have a Metacello configuration like ConfigurationOfAthens and I want to know which packages provides, the result would be :

  • Athens-Cairo
  • Athens-CairoPools
  • Athens-Core
  • etc.

I tried

(GoferConfigurationReference name: 'ConfigurationOfAthens') packages.

but it is not understood by the system.

It this supported in Pharo 4?

user869097
  • 1,362
  • 8
  • 16

1 Answers1

1

If you want just the package names you could use helper classes to query from a Configuration. And so your query would be

(MTProject 
    newFromVersion: (ConfigurationOfAthens project version: #development)
    inConfiguration: ConfigurationOfAthens) dependenciesFilteredBy: MTPackage.

These MT classes - which sounds like they should belong to Metacello - are not in Metacello package, but currently in Versionner (included by default in Pharo images).

Diving into results reveals that some "MTPackages" has not their corresponding "RPackage" (this could be a bug, or some weird feature in the package representation models). So you would need further filtering:

((MTProject 
    newFromVersion: (ConfigurationOfAthens project version: #development)
    inConfiguration: ConfigurationOfAthens) dependenciesFilteredBy: MTPackage)
        select: [ :pkgName | 
            (RPackageOrganizer default 
                packageNamed: pkgName name asSymbol
                ifAbsent: []) notNil  ]
Hernán
  • 1,749
  • 10
  • 12
  • Reason why not all MTPackage have a corresponding RPackage is that not all packages in a configuration needs to end inside the image (for example, different platform packages, etc.). If you want to know which packages will be loaded (without loading it), you need to use #record. – EstebanLM Mar 01 '16 at 07:05