Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 279015 - Support update descriptor advice in p2.inf
Summary: Support update descriptor advice in p2.inf
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Ian Bull CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 282545 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-03 16:11 EDT by Simon Kaegi CLA
Modified: 2010-08-03 17:01 EDT (History)
2 users (show)

See Also:


Attachments
patch v1 (32.31 KB, patch)
2010-07-12 10:42 EDT, Ian Bull CLA
no flags Details | Diff
mylyn/context/zip (150.91 KB, application/octet-stream)
2010-07-12 10:42 EDT, Ian Bull CLA
no flags Details
Patch v2 (31.60 KB, patch)
2010-07-12 11:57 EDT, Ian Bull CLA
no flags Details | Diff
mylyn/context/zip (182.55 KB, application/octet-stream)
2010-07-12 11:57 EDT, Ian Bull CLA
no flags Details
Patch v3 (40.85 KB, patch)
2010-07-12 14:25 EDT, Ian Bull CLA
no flags Details | Diff
mylyn/context/zip (424.02 KB, application/octet-stream)
2010-07-12 14:25 EDT, Ian Bull CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2009-06-03 16:11:35 EDT
A p2.inf file will let your modfiy the properties, capabilities, and touchpoint instructions of an IU. We should also permit altering the update descriptor.
Comment 1 Ian Bull CLA 2010-07-11 09:57:02 EDT
Simon, do you have any ideas for the syntax?  I'm going to tackle this for 3.7 M1.  

I was thinking of something like:
updateDescriptor.name = testName
updateDescriptor.lowerBound = ( optional / default 0.0.0 )
updateDescriptor.upperBound = ( optional / default iu.version)

That is, if you don't specify a version you get [0.0.0, current) which is the current default behaviour.

We should also support the 'additional IU authoring'.  For example:
iu.<#>.updateDescriptor.name = testName
iu.<#>.updateDescriptor.lowerBound = ( optional / default 0.0.0 )
iu.<#>.updateDescriptor.upperBound = ( optional / default iu.version)
Comment 2 Ian Bull CLA 2010-07-12 08:36:55 EDT
*** Bug 282545 has been marked as a duplicate of this bug. ***
Comment 3 Ian Bull CLA 2010-07-12 10:42:54 EDT
Created attachment 174034 [details]
patch v1

Here is an initial cut at this.

I use the lowerBound / upperBound properties, but I don't really like them.  I think it would be better to use update.range instead. However, here was my thinking:

One (important) use for this feature is to stage updates.  (when v3 is released force people to update from v1 -> v2 -> v3).  In this case you would set the UpdateDescriptor on v3 to be [v2, v3).  By splitting out upper and lower bound, I thought we could make this easy

update.lowerBound = v2

If we went with range, you would either have to know your current version
update.range = [v2, v3) <-- which is very unlikley when you consider qualifiers, or we need a version syntax that means 'current'.

update.range = [v2, CURRENT)
or 
update.range = [v2,)

(Note: empty upper bound means CURRENT.
Comment 4 Ian Bull CLA 2010-07-12 10:42:58 EDT
Created attachment 174035 [details]
mylyn/context/zip
Comment 5 Andrew Niefer CLA 2010-07-12 10:46:34 EDT
Instead of lowerBound/upperBound, why not just use "range" like in requires.

Also, there seems to be a "severity" field in the metadata, not sure what it is for.
Comment 6 Andrew Niefer CLA 2010-07-12 10:48:57 EDT
Note that we already have "$version$" and "$qualifier$" which represent the version and qualifier for the IU the p2.inf belongs to.
Comment 7 Ian Bull CLA 2010-07-12 11:22:01 EDT
(In reply to comment #5)
> Also, there seems to be a "severity" field in the metadata, not sure what it is
> for.
+1, yep, I added this and update.description.  

(In reply to comment #6)
> Note that we already have "$version$" and "$qualifier$" which represent the
> version and qualifier for the IU the p2.inf belongs to.

I didn't realize we had this syntax.  This makes the range stuff work much better.

update.range=(1.0.0,$version$]

I will do it this way then. 
Thanks Andrew.
Comment 8 Ian Bull CLA 2010-07-12 11:57:15 EDT
Created attachment 174057 [details]
Patch v2

Here is an update. This uses update.range, and support $version$ and $qualifier$.

I've included some unit tests, however, I still need to create some tests that use a real p2.inf file to ensure this integrates properly with the rest of the publisher.
Comment 9 Ian Bull CLA 2010-07-12 11:57:20 EDT
Created attachment 174058 [details]
mylyn/context/zip
Comment 10 Ian Bull CLA 2010-07-12 14:25:44 EDT
Created attachment 174081 [details]
Patch v3

I've added some integration test for bundles. I just need one for features now.
Comment 11 Ian Bull CLA 2010-07-12 14:25:54 EDT
Created attachment 174082 [details]
mylyn/context/zip
Comment 12 Ian Bull CLA 2010-07-13 08:31:17 EDT
I've released this last night for Today's IBuild.  I've tested it manually with plug-ins and features, and it looks good. I've also written some automated tests for plug-ins.  I still want to write an automated test for features.
Comment 13 Ian Bull CLA 2010-08-03 17:01:52 EDT
This was actually fixed a few weeks ago.  Closing.