[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] IDirector and IEngine


Hi Eugen, there is some background information on these concepts here:

http://wiki.eclipse.org/Equinox/p2/Concepts

John



Eugen Reiswich <reiswich@xxxxxx>
Sent by: p2-dev-bounces@xxxxxxxxxxx

09/10/2008 01:44 PM

Please respond to
P2 developer discussions <p2-dev@xxxxxxxxxxx>

To
P2 developer discussions <p2-dev@xxxxxxxxxxx>
cc
Subject
[p2-dev] IDirector and IEngine





Hi folks,

I'm trying to get familiar with p2 and had a look at the p2 tests (org.eclipse.equinox.p2.tests).  Basically I'm looking for install/update/unistall operations with P2.

Right now I don't get the point with IDirector and IEngine. It seems that both are able to install IUs, is that right? The IDirector has a provision(...) method while the IEngine has a perform(...) method. So which one do I have to use if I want to create a custom provisioning GUI? 

Is this the best way to install IUs (found in org.eclipse.equinox.p2.tests):

protected IStatus install(IProfile profile, IInstallableUnit[] ius, boolean strict, IPlanner planner, IEngine engine) {
ProfileChangeRequest req = new ProfileChangeRequest(profile);
req.addInstallableUnits(ius);
for (int i = 0; i < ius.length; i++) {
req.setInstallableUnitInclusionRules(ius[i], strict ? PlannerHelper.createStrictInclusionRule(ius[i]) : PlannerHelper.createOptionalInclusionRule(ius[i]));
}

ProvisioningPlan plan = planner.getProvisioningPlan(req, null, null);
if (plan.getStatus().getSeverity() == IStatus.ERROR || plan.getStatus().getSeverity() == IStatus.CANCEL)
return plan.getStatus();
return engine.perform(profile, new DefaultPhaseSet(), plan.getOperands(), null, null);
}

Regards,
Eugen_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev