Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Downgrade feature with multiple installed versions(Have feature v1.0 and v2.0, but want to remove v2.0)
Downgrade feature with multiple installed versions [message #1172411] Tue, 05 November 2013 22:43 Go to next message
Alexandros Karypidis is currently offline Alexandros Karypidis
Messages: 53
Registered: March 2010
Member
Hi all,

Suppose an RCP application has 2 versions of the same feature (suppose 2.0.0 was installed and is the one currently in effect, with v1.0.0 still present but only included in a previous profile):

- test.feature.feature.group 1.0.0
- test.feature.feature.group 2.0.0

On startup, the application somehow decides a downgrade is needed (specifically an HTTP GET from a well-known URL returns a special value) and that test.feature.feature.group 2.0.0 must this be removed . So far so good.

PROBLEM: I try to "auto-cleanup" such cases as follows:

    boolean downgrade = checkWebServerVersion();
    if (! downgrade) return; // we are ok

    Set<IInstallableUnit> toUninstall = getDowngradeFeatures();
    // assume toUninstall has "test.feature.feature.group 2.0.0"

    if (toUninstall.size() > 0) {
        UninstallOperation op = new UninstallOperation(session, toUninstall);
        IStatus result = op.resolveModal(monitor);
        if (result.isOK()) {
            op.getProvisioningJob(monitor).runModal(monitor);
    }


I ran the above and surprisingly test.feature.feature.group 1.0.0 was removed instead! Any ideas why this could happen?
Re: Downgrade feature with multiple installed versions [message #1180048 is a reply to message #1172411] Sun, 10 November 2013 18:53 Go to previous message
Pascal Rapicault is currently offline Pascal Rapicault
Messages: 290
Registered: July 2009
Location: Ottawa
Senior Member
I'm suprised by your description since this code is used by the p2 UI when performing the uninstallation. I quickly looked at the UninstallOperation code and the IU being uninstalled is the IU being passed as a parameter.

If you can provide a simple setup to reproduce this, then we can further investigate.
Otherwise, make sure that the ID's and versions being passed in are the right ones and that the profiles do include the version of the IUs you intend.

HTH

Pascal
Previous Topic:non-deterministic p2 configuration generation on first start
Next Topic:Service Factory with Declared Service
Goto Forum:
  


Current Time: Tue Sep 02 21:22:19 GMT 2014

Powered by FUDForum. Page generated in 0.06643 seconds