Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 296558 - Wrong version attribute for the self provided capability of a category IU
Summary: Wrong version attribute for the self provided capability of a category IU
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-01 05:02 EST by Sasa Zivkov CLA
Modified: 2009-12-03 04:06 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch for the reported bug (1.02 KB, patch)
2009-12-01 05:04 EST, Sasa Zivkov CLA
aniefer: iplog+
Details | Diff
Example project to reproduce the bug (1.53 KB, application/octetstream)
2009-12-01 05:06 EST, Sasa Zivkov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sasa Zivkov CLA 2009-12-01 05:02:13 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: M20090917-0800

Export of deployable feature using the "categorize repository" option results in a wrong version attribute for the self provided capability of category IU in the created p2 repository.

This is what was created:
    <unit id='my.category' version='0.0.0.20091201103322'>
      <properties size='3'>
        <property name='org.eclipse.equinox.p2.name' value='Category'/>
        <property name='org.eclipse.equinox.p2.description' value='Description'/>
        <property name='org.eclipse.equinox.p2.type.category' value='true'/>
      </properties>
      <provides size='1'>
        <provided namespace='org.eclipse.equinox.p2.iu' name='my.category' version='0.0.0'/>
      </provides>

And this is what was expected:
    <unit id='my.category' version='0.0.0.20091201103322'>
      <properties size='3'>
        <property name='org.eclipse.equinox.p2.name' value='Category'/>
        <property name='org.eclipse.equinox.p2.description' value='Description'/>
        <property name='org.eclipse.equinox.p2.type.category' value='true'/>
      </properties>
      <provides size='1'>
        <provided namespace='org.eclipse.equinox.p2.iu' name='my.category' version='0.0.0.20091201103322'/>
      </provides>

In the source code we see that for the self provided capability version always an empty version is set. 


Reproducible: Always

Steps to Reproduce:
1. create an empty feature
2. create category.xml file which defines one category for the feature created in step 1
3. right-click on the feature project -> Export -> Deployable Features, Next, select the Options tab, check "categorize repository" and point to the category.xml file
4. Finish

Now check the content.xml contained in the <output-dir>\content.jar according to the detailed bug description.
Comment 1 Sasa Zivkov CLA 2009-12-01 05:04:37 EST
Created attachment 153429 [details]
Proposed patch for the reported bug
Comment 2 Sasa Zivkov CLA 2009-12-01 05:06:10 EST
Created attachment 153430 [details]
Example project to reproduce the bug
Comment 3 Andrew Niefer CLA 2009-12-02 17:19:08 EST
done in HEAD and the api branch.  Also added a small test.
Comment 4 Edwin Kempin CLA 2009-12-03 04:06:14 EST
Hi Andrew,
thank you very much to pick up this issue so fastly!
Would it be possible to get the same bug-fix for 3.5.2?