Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Profile properties preventing p2 update
Profile properties preventing p2 update [message #559723] Fri, 17 September 2010 17:04 Go to next message
Patrick Paulin is currently offline Patrick Paulin
Messages: 39
Registered: July 2009
Location: Madison, Wisconsin
Member
We currently have a p2 auto-update (Eclipse 3.5) process that manages IUs at a low level. This means that during an update we add and remove every relevant IU (bundles, tooling, etc.)

We're trying to switch to auto-update logic that deals only with high-level IUs (features and products), allowing p2 to deal with the low-level details.

The problem is that we can't update from the old logic to the new logic. We've narrowed down the problem to iuProperties entries in the profile. The old logic resulted in iuProperties entries for each low-level IU, and the properties are usually:

<property name='org.eclipse.equinox.p2.internal.inclusion.rules' value='STRICT'/>

The new auto-update logic is attempting to install just the high level features and products but my guess is that the planner is saying "Hey, you need to install these low level IUs too". The actual error message looks like this:

Status severity= 4, code = 1, message = Cannot complete the install because of a conflicting dependency.
Status contains child status objects
Status severity= 4, code = 0, message = Software being installed: Product Name 1.0.0.1009170900-8505 (com.company.app.application.product 1.0.0.1009170900-8505)
Status severity= 4, code = 0, message = Software currently installed: toolingcom.company.app.application.product.configuration 1.0.0.1009170845-8505
Status severity= 4, code = 1, message = Only one of the following can be installed at once:
Status contains child status objects
Status severity= 4, code = 0, message = toolingcom.company.app.application.product.configuration 1.0.0.1009170900-8505
Status severity= 4, code = 0, message = toolingcom.company.app.application.product.configuration 1.0.0.1009170845-8505
Status severity= 4, code = 1, message = Cannot satisfy dependency:
Status contains child status objects
Status severity= 4, code = 0, message = From: Product Name 1.0.0.1009170900-8505 (com.company.app.application.product 1.0.0.1009170900-8505)
Status severity= 4, code = 0, message = To: toolingcom.company.app.application.product.configuration [1.0.0.1009170900-8505]

What I'm wondering is:

* Does it make sense that these profile iuProperties entries would cause a problem like this? If I remove the entries, the update runs successfully.

* Is there any way to programmatically remove the iuProperties entries?

* Has any work been done in 3.6 that would improve how the planner handles this situation? It would take some work to migrate, but it would be worth it to resolve this issue.

Thanks in advance for any help.




Patrick Paulin
Eclipse RCP/OSGi Trainer and Consultant
Modular Mind, Ltd.

patrick@modumind.com
www.modumind.com
twitter.com/pjpaulin
linkedin.com/in/pjpaulin
Re: Profile properties preventing p2 update [message #559748 is a reply to message #559723] Fri, 17 September 2010 20:39 Go to previous messageGo to next message
Patrick Paulin is currently offline Patrick Paulin
Messages: 39
Registered: July 2009
Location: Madison, Wisconsin
Member
Our solution was to programmatically remove the iusProperties element from the profile during the conversion process. Not pretty, but it worked.


Patrick Paulin
Eclipse RCP/OSGi Trainer and Consultant
Modular Mind, Ltd.

patrick@modumind.com
www.modumind.com
twitter.com/pjpaulin
linkedin.com/in/pjpaulin
Re: Profile properties preventing p2 update [message #651683 is a reply to message #559723] Tue, 01 February 2011 09:23 Go to previous messageGo to next message
Bernardo Buffa Colome is currently offline Bernardo Buffa Colome
Messages: 2
Registered: February 2011
Junior Member
Hi,

Could you give us more detail about your solution?

We are trying to modify the iuProperties map on the profile, but every time we ask for the profile to the IProfileRegistry (SimpleProfileRegistry) .getProfile(String profileId), the instance returned is a fresh snapshot.

...
public static final String INCLUSION_RULES_KEY = "org.eclipse.equinox.p2.internal.inclusion.rules";


IProfileRegistry reg=(IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = reg.getProfile(IProfileRegistry.SELF);
Profile pf=(Profile)profile;
Iterator<IInstallableUnit> units=pf.everything();
while(units.hasNext()) {
IInstallableUnit iu=units.next();
logger.log(ILog.INFO, "IU: " + iu.toString() + ", \"" + INCLUSION_RULES_KEY + "\"=\""+ pf.getInstallableUnitProperty(iu, INCLUSION_RULES_KEY)+"\"");
pf.setInstallableUnitProperty(iu, INCLUSION_RULES_KEY, "STRICT");
logger.log(ILog.INFO, "IU: " + iu.toString() + ", \"" + INCLUSION_RULES_KEY + "\"=\""+ pf.getInstallableUnitProperty(iu, INCLUSION_RULES_KEY)+"\"");
}
...






How you've managed to modify these properties ("org.eclipse.equinox.p2.internal.inclusion.rules") on the IProfile instance used later by UpdateOperation.computeProfileChangeRequest ? Is that the way you have taken?.


Thanks in advance
Bernardo


P.S.
I've tried also to write our own version of UpdateOperation (within the same package org.eclipse.equinox.internal.p2.operations) without success, an IllegalAccessException is thrown when accessing superclass (ProfileChangeOperation).

Re: Profile properties preventing p2 update [message #652567 is a reply to message #651683] Fri, 04 February 2011 15:01 Go to previous messageGo to next message
Esteban  is currently offline Esteban
Messages: 1
Registered: February 2011
Junior Member
We had a similar issue but opposite (we needed to set the inclusion rule to STRICT for a specific IU instead of removing it) and what seemed to work for us was to create a ProfileChangeRequest, set the strict flag and finally provision the installable unit again even though the installable unit was already provisioned in the profile.
Something like this worked for us
        final IInstallableUnit toInstall = someIU;
        final ProfileChangeRequest pcr = new ProfileChangeRequest(profile);
        pcr.add(toInstall);
        pcr.setInstallableUnitInclusionRules(toInstall, ProfileInclusionRules.createStrictInclusionRule(toInstall));
        pcr.setAbsoluteMode(true);

        final ProvisioningContext pc = new ProvisioningContext(profile.getProvisioningAgent());
        final IStatus status = director.provision(pcr, pc, null);


At the end the IU was modified to include the STRICT property in the profile.
Hope this helps.

Re: Profile properties preventing p2 update [message #652925 is a reply to message #652567] Mon, 07 February 2011 16:11 Go to previous message
Bernardo Buffa Colome is currently offline Bernardo Buffa Colome
Messages: 2
Registered: February 2011
Junior Member
Which eclipse version are you using? Can't find the method setAbsoluteMode in the ProfileChangeRequest in my 3.6.1 helios version.
Previous Topic:No line information available when built headless
Next Topic:P2 director application - handling of optional dependencies
Goto Forum:
  


Current Time: Tue Sep 23 06:38:57 GMT 2014

Powered by FUDForum. Page generated in 0.02131 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software