Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 246060

Summary: Replace versions in .product file
Product: [Eclipse Project] PDE Reporter: Helmut J. Haigermoser <helmut.haigermoser>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, bvitale3002, egalvez, irbull, qwang, rpk_pro, spektom
Version: 4.0   
Target Milestone: 3.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 260066    

Description Helmut J. Haigermoser CLA 2008-09-03 05:15:52 EDT
Build ID: 3.4

Steps To Reproduce:
1. Create a product, define it's version as 1.0.0.qualifier in the .product file
2. Export the product using pde build
3. Note that the qualifier does not get translated


More information:
here is the product line from my installer.product:

<product name="%productName" id="com.windriver.p2.installer.ui.product" application="com.windriver.p2.installer.ui.application" version="1.0.0.qualifier" useFeatures="false">

Here is a conversation from p2-dev that lead to this bugzilla:
1.) My question:
Ciao Guys :)
Would you be able to help me with the following problem please?
The overall issue I'm having is a failing update-ProvisioningPlan. The
workaround I'm using right now seems to prove my theory below, but I'd
like you guys to confirm before I create a bugzilla.

Using 3.4 I'm exporting a product into a p2 repository, using qualifiers
in the bundle versions to generate more recent versions whenever a build
is finished. Now, when trying to update myself during the initial run of
my product the Query looking for updates does find them correctly but
the ProvisioningPlan never returns "isOK". Looking at content.xml I
found out that the group, generated from the product, has the version
"1.0.0" just like my product-definition indicates. The inclusion rules
of that group are very strict so that updates are only possible for the
entire group, which is fine in this scenario so I went ahead and changed
the version of the product to '1.0.0.qualifier'. However, looking at the
repository the qualifier never got translated and was put as-is into
content.xml. 

Long story short, my release-script replaces "qualifier" with a real
qualifier now and things start to work...
There is two solutions I can see here:
- Change the group definitions to have a wider VersionRange so that
individual plug-ins may be updated or
- Allow for qualifiers in the product version to support updating the
product along with the changed bundle.

Maybe I'm not seeing the obvious solution here, please advise !:)


2.) Response from Pascal:
Hi Helmut, 
This is a well-known problem. Please open a bug against PDE Build.
PaScaL
Comment 1 Andrew Niefer CLA 2008-09-09 15:43:12 EDT
2 other items, .product file may have version information for the plugins/feature list (even though the editor does not show versions there).  We should consider .qualifier there as well.

Similarly, the property p2.root.version which is used in the absence of the .product file is also a candidate for replacement.
Comment 2 Eddie Galvez CLA 2009-03-09 09:35:17 EDT
+1

We also have to have a custom build step that replaces the version in the .product file, before invoking PDE build/P2 stuff.
Comment 3 Andrew Niefer CLA 2009-03-11 15:46:04 EDT
done.

products with versions ending in ".qualifier" will get the qualifier replaced with the property "p2.product.qualifier".

The default value of this property will be generated according to 
1) forceContextQualifier
2) timestamp 

Note that the .product file itself is not modified, but rather a copy is generated with the new versions.  The copy is placed in ${buildDirectory}/features/org.eclipse.pde.build.container.feature/product, and this is the copy the p2 metadata generation works from.

Comment 4 Helmut J. Haigermoser CLA 2009-03-12 04:59:07 EDT
Thanks Andrew, 't will be some time till I can test this in my release environment but I'll eventually report back! :)
Helmut
Comment 5 Michael Spector CLA 2009-05-17 07:48:18 EDT
Not fixed.
I set p2.product.qualifier in build.properties, however what I get in the generated repository's content.xml is non-modifier version:

1.0.0.qualifier

I use basebuilder from 3.5M7.
Comment 6 Andrew Niefer CLA 2009-06-02 13:47:26 EDT
This is working for me in publisher based builds (p2.gathering=true).

If you have a metadata generator based build with p2.generate.metadata=true, see bug 277514.

product qualifier replacement does not apply to non-p2 builds.

Michael, if bug 277514 doesn't apply can you please open a new bug with the details.  I would like to keep this bug as the overall enhancement which is done and have separate bugs if there are particular cases where there are problems.