Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 388031 - When installing new bundles p2 always immediately updates the bundle
Summary: When installing new bundles p2 always immediately updates the bundle
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: Juno SR1   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 387611
Blocks:
  Show dependency tree
 
Reported: 2012-08-24 16:37 EDT by Ian Bull CLA
Modified: 2012-09-07 16:22 EDT (History)
4 users (show)

See Also:
irbull: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Bull CLA 2012-08-24 16:37:04 EDT
+++ This bug was initially created as a clone of Bug #387611 +++

This got introduced with the "fix" in bug 326745.

The following code got added with that fix:


current = manipulatingContext.installBundle(bundleLocation);
if (!version.equals(current.getVersion()) || 
    !symbolicName.equals(current.getSymbolicName()))
	// can happen if, for example, the new version of the bundle is installed
	// to the same bundle location as the old version
	current.update();

The problem is that "version" here is a String and current.getVersion returns a Version object so the version.equals(current.getVersion()) call never returns true.  This means that every install is immediately followed by an unnecessary update.
Comment 1 Ian Bull CLA 2012-08-24 17:29:28 EDT
Tom wrote this and I've +1ed it (And released into into Juno SR1).

http://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=676e516bbf89464faf01deccd8ed03cbd8835f55

I think that's all we need at this point.