[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] P2: wich IUs to install?

I have given a look to M7 to see how this thing was finally implemented, but I found that it is still open:

    protected IInstallableUnit[] addTransitiveIUs(IMetadataRepository source, IInstallableUnit[] roots) {
        // TODO Here we should create a profile from the source repo and discover all the
        // IUs that are needed to support the given roots.  For now just assume that the
        // given roots are enough.
        return roots;

In fact, I wonder why "Mirroring" and "Installing" aren't just the same thing.

If I create a "fake" profile for the target repository and then create a ProfileChange request with the UIs that I want to mirror, I get back from the planner ther list of the InstallOperations to perform (that is the list of the prerequisites UIs).
If I then execute the plan, it looks like I have what I need ("promoting" an IU with its prerequisites from a test repository to a production one).

Am I missing something?

Best regards,
Alessandro Mottadelli

Ian Bull ha scritto:
You could like use the slicer for this.

Something like this:
PermissiveSlicer slicer = new PermissiveSlicer(getCompositeMetadataRepository(), slicingOptions.getFilter(), slicingOptions.includeOptionalDependencies(), slicingOptions.isEverythingGreedy(), slicingOptions.forceFilterTo(), slicingOptions.considerStrictDependencyOnly());

return slicer.slice((IInstallableUnit[]) sourceIUs.toArray(new IInstallableUnit[sourceIUs.size()]), monitor);

In this case you are creating a permissive slicer and then querying it for the "slice" given a set of root (or source in this case) IUs.

Checkout the mirror application in repository tools (it is very new), it does this.


On Fri, Mar 6, 2009 at 1:11 PM, Alessandro Mottadelli <amottadelli@xxxxxxxx> wrote:

Is there a way to discover, given a set of IUs wich other IUs I have to add to make the set installable?
In other words: how can I calculate the transitive closure of the dependency tree of the given IUs?

Alessandro Mottadelli
p2-dev mailing list

R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource

_______________________________________________ p2-dev mailing list p2-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/p2-dev