Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » P2 and Feature Patch
P2 and Feature Patch [message #528377] Tue, 20 April 2010 06:04 Go to next message
Stefan Stern is currently offline Stefan Stern
Messages: 9
Registered: July 2009
Junior Member
Hello

We maintain an internal IDE, which we use as development IDE. It comes
with GEF, EMF, Eclipse SDK and some plugins which we develop internally
that extend the Eclipse SDK. All Eclipse features are based on the
latest 3.5.2 releases.

Our internal stuff comes with a feature of its own. All parts are
bundled in a product definition, which defines all features that form
the product. The deployment is done with the Export wizard.

Now we stumbled across the issue, that we need a new version of one of
those plugins, which we develop internally. First thing we tried: make a
new version of the plugin, then increment the version of the feature
which includes the affected bundle, export it into a new P2 repository
and try to update the running IDE. That won't do, as the product defines
the exact feature version it requires. Doing so, prevents the update to
install the new version, as the product won't let it.

OK. So we made a feature patch, based on the version of the existing
feature, updating it to an incremtented version, bringing the new
version of the bundle. We exported that to a new P2 repository, which we
made available as new Software site. When calling "check for update",
the manager tells "none required". That's ok, we talk about a feature
patch, not a new version of the feature. So we call "install new
software", select the feature patch from the P2 repo created before,
performing the installation, restarting the IDE and - surprise - the
feature patch is installed, but the bundle that should have been updated
is just the version it was before! Nothing happened. Provisioning
Metadata of the repo is correct, it tells the feature patch would update
the bundle from any version to the new version. But the feature patch
installation leaves the bundle untouched.

After uninstalling the feature patch, we built a wrapping feature, which
includes the feature patch, and installed that new feature into the IDE.
This caused the feature patch to be installed as well, but again the
bundle remains on its old version.

Do we have to increment the product version, any time we modify
something in any bundle delivered with the product? And then redeploy
the whole new product? Is there no way to update a single bundle to a
new version, in case it is a minor change, if the bundle was delivered
in terms of a product? Or is there something we overlooked in the P2 usage?

Thanks in advance and kind regards,
Stefan Stern
Re: P2 and Feature Patch [message #528507 is a reply to message #528377] Tue, 20 April 2010 14:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

This is a multi-part message in MIME format.
--------------000809000907050408030607
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

The feature patch should update the bundle specified, and you shouldn't
have to update your product (at least I don't believe so).

My own feature patch on the eclipse 3.5 SDK was little more than
standard feature stuff and:
<requires>
<import feature="org.eclipse.rcp" version="3.5.0" patch="true"/>
</requires>
<plugin id="org.eclipse.core.contenttype" download-size="0"
install-size="0" version="0.0.0" unpack="false"/>


It generated a feature IU (attached) with the <changes> element with my
change in it.

<change>
<from>
<required namespace='org.eclipse.equinox.p2.iu'
name='org.eclipse.core.contenttype' range='0.0.0'/>
</from>
<to>
<required namespace='org.eclipse.equinox.p2.iu'
name='org.eclipse.core.contenttype'
range=''/>
</to>
</change>

It also tied it to a very specific version of the feature I was patching.

Did your generated feature patch IU look like mine? Was there any
complaints in the .log?

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


--------------000809000907050408030607
Content-Type: text/xml;
name="feature_patch.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="feature_patch.xml"

<unit id=3D'org.eclipse.e4.resources.rcp.patch.feature.group' version=
=3D'0.9.0.v20090609-1530-48Z-7w311A143102241' singleton=3D'false'>
<patchScope>
<scope>
<requires size=3D'1'>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org=
=2Eeclipse.rcp.feature.group' range=3D''/>
</to>
</change>
</changes>
<lifeCycle>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.rcp.feature.group' range=3D'[3.5.0,4.0.0)' greedy=3D'false'/>
</lifeCycle>
<update id=3D'org.eclipse.e4.resources.rcp.patch.feature.group' ran=
ge=3D'[0.0.0,0.9.0.v20090609-1530-48Z-7w311A143102241)' severity=3D'0'/>
<properties size=3D'10'>
<property name=3D'org.eclipse.equinox.p2.type.patch' value=3D'tru=
e'/>
<property name=3D'org.eclipse.equinox.p2.name' value=3D'%featureN=
ame'/>
<property name=3D'org.eclipse.equinox.p2.description' value=3D'%d=
escription'/>
<property name=3D'org.eclipse.equinox.p2.provider' value=3D'%prov=
iderName'/>
<property name=3D'org.eclipse.equinox.p2.type.group' value=3D'tru=
e'/>
<property name=3D'df_LT.featureName' value=3D'Eclipse e4 Resource=
s RCP Patch (Incubation)'/>
<property name=3D'df_LT.copyright' value=3D'Copyright (c) 2000, 2=
008 IBM Corporation and others.&#xA;All rights reserved. This program and=
the accompanying materials&#xA;are made available under the terms of the=
Eclipse Public License v1.0&#xA;which accompanies this distribution, and=
is available at&#xA;http://www.eclipse.org/legal/epl-v10.html&#xA;&#xA;C=
ontributors:&#xA;IBM Corporation - initial API and implementation'/>
<property name=3D'df_LT.providerName' value=3D'Eclipse.org'/>
<property name=3D'df_LT.description' value=3D'Eclipse e4 Resource=
s RCP Patch'/>
<property name=3D'df_LT.license' value=3D'ECLIPSE FOUNDATION SOFT=
WARE USER AGREEMENT&#xA;March 17, 2005&#xA;&#xA;Usage Of Content&#xA;&#xA=
;THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMAT=
ION AND/OR&#xA;OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY &qu=
ot;CONTENT&quot;).&#xA;USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CO=
NDITIONS OF THIS&#xA;AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE=
AGREEMENTS OR&#xA;NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CO=
NTENT, YOU&#xA;AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGR=
EEMENT&#xA;AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGRE=
EMENTS&#xA;OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE =
TO THE&#xA;TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDI=
TIONS&#xA;OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR RE=
FERENCED&#xA;BELOW, THEN YOU MAY NOT USE THE CONTENT.&#xA;&#xA;Applicable=
Licenses&#xA;&#xA;Unless otherwise indicated, all Content made available=
by the Eclipse Foundation&#xA;is provided to you under the terms and con=
ditions of the Eclipse Public&#xA;License Version 1.0 (&quot;EPL&quot;). =
A copy of the EPL is provided with this&#xA;Content and is also available=
at http://www.eclipse.org/legal/epl-v10.html.&#xA;For purposes of the EP=
L, &quot;Program&quot; will mean the Content.&#xA;&#xA;Content includes, =
but is not limited to, source code, object code,&#xA;documentation and ot=
her files maintained in the Eclipse.org CVS&#xA;repository (&quot;Reposit=
ory&quot;) in CVS modules (&quot;Modules&quot;) and made available&#xA;as=
downloadable archives (&quot;Downloads&quot;).&#xA;&#xA;- Content may be=
structured and packaged into modules to facilitate delivering,&#xA;exten=
ding, and upgrading the Content. Typical modules may include plug-ins (&q=
uot;Plug-ins&quot;),&#xA;plug-in fragments (&quot;Fragments&quot;), and f=
eatures (&quot;Features&quot;).&#xA;- Each Plug-in or Fragment may be pac=
kaged as a sub-directory or JAR (Java? ARchive)&#xA;in a directory named =
&quot;plugins&quot;.&#xA;- A Feature is a bundle of one or more Plug-ins =
and/or Fragments and associated material.&#xA;Each Feature may be package=
d as a sub-directory in a directory named &quot;features&quot;.&#xA;Withi=
n a Feature, files named &quot;feature.xml&quot; may contain a list of th=
e names and version&#xA;numbers of the Plug-ins and/or Fragments associat=
ed with that Feature.&#xA;- Features may also include other Features (&qu=
ot;Included Features&quot;). Within a Feature, files&#xA;named &quot;feat=
ure.xml&quot; may contain a list of the names and version numbers of Incl=
uded Features.&#xA;&#xA;Features may also include other Features (&quot;I=
ncluded Features&quot;). Files named&#xA;&quot;feature.xml&quot; may cont=
ain a list of the names and version numbers of&#xA;Included Features.&#xA=
;&#xA;The terms and conditions governing Plug-ins and Fragments should be=
&#xA;contained in files named &quot;about.html&quot; (&quot;Abouts&quot;)=
=2E The terms and&#xA;conditions governing Features and Included Features=
should be contained&#xA;in files named &quot;license.html&quot; (&quot;F=
eature Licenses&quot;). Abouts and Feature&#xA;Licenses may be located in=
any directory of a Download or Module&#xA;including, but not limited to =
the following locations:&#xA;&#xA;- The top-level (root) directory&#xA;- =
Plug-in and Fragment directories&#xA;- Inside Plug-ins and Fragments pack=
aged as JARs&#xA;- Sub-directories of the directory named &quot;src&quot;=
of certain Plug-ins&#xA;- Feature directories&#xA;&#xA;Note: if a Featur=
e made available by the Eclipse Foundation is installed using the&#xA;Ecl=
ipse Update Manager, you must agree to a license (&quot;Feature Update&#x=
A;License&quot;) during the installation process. If the Feature contains=
&#xA;Included Features, the Feature Update License should either provide =
you&#xA;with the terms and conditions governing the Included Features or =
inform&#xA;you where you can locate them. Feature Update Licenses may be =
found in&#xA;the &quot;license&quot; property of files named &quot;featur=
e.properties&quot;. Such Abouts,&#xA;Feature Licenses and Feature Update =
Licenses contain the terms and&#xA;conditions (or references to such term=
s and conditions) that govern your&#xA;use of the associated Content in t=
hat directory.&#xA;&#xA;THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE L=
ICENSES MAY REFER&#xA;TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR =
TERMS AND CONDITIONS.&#xA;SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCL=
UDE (BUT ARE NOT LIMITED TO):&#xA;&#xA;- Common Public License Version 1.=
0 (available at http://www.eclipse.org/legal/cpl-v10.html)&#xA;- Apache S=
oftware License 1.1 (available at http://www.apache.org/licenses/LICENSE)=
&#xA;- Apache Software License 2.0 (available at http://www.apache.org/li=
censes/LICENSE-2.0)&#xA;- IBM Public License 1.0 (available at http://oss=
=2Esoftware.ibm.com/developerworks/opensource/license10.html )&#xA;- Metro=
Link Public License 1.00 (available at http://www.opengroup.org/openmoti=
f/supporters/metrolink/license.html)&#xA;- Mozilla Public License Version=
1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)&#xA;&#xA;IT I=
S YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR&=
#xA;TO USE OF THE CONTENT. If no About, Feature License or Feature Update=
License&#xA;is provided, please contact the Eclipse Foundation to determ=
ine what terms and conditions&#xA;govern that particular Content.&#xA;&#x=
A;Cryptography&#xA;&#xA;Content may contain encryption software. The coun=
try in which you are&#xA;currently may have restrictions on the import, p=
ossession, and use,&#xA;and/or re-export to another country, of encryptio=
n software. BEFORE&#xA;using any encryption software, please check the co=
untry&apos;s laws,&#xA;regulations and policies concerning the import, po=
ssession, or use,&#xA;and re-export of encryption software, to see if thi=
s is permitted.&#xA;&#xA;Java and all Java-based trademarks are trademark=
s of Sun Microsystems, Inc. in the United States, other countries, or bot=
h.'/>
</properties>
<provides size=3D'2'>
<provided namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.e4.resources.rcp.patch.feature.group' version=3D'0.9.0.v20090609-153=
0-48Z-7w311A143102241'/>
<provided namespace=3D'org.eclipse.equinox.p2.localization' name=3D=
'df_LT' version=3D'1.0.0'/>
</provides>
<requires size=3D'2'>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.e4.resources.rcp.patch.feature.jar' range=3D'[0.9.0.v20090609-1530-4=
8Z-7w311A143102241,0.9.0.v20090609-1530-48Z-7w311A143102241] ' >
<filter>
(org.eclipse.update.install.features=3Dtrue)
</filter>
</required>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.rcp.feature.group' range=3D'[3.5.0,4.0.0)' greedy=3D'false'/>
</requires>
<touchpoint id=3D'null' version=3D'0.0.0'/>
<licenses size=3D'1'>
<license uri=3D'%25licenseURL' url=3D'%25licenseURL'>
%license
</license>
</licenses>
<copyright>
%copyright
</copyright>
</unit>

--------------000809000907050408030607--


Re: P2 and Feature Patch [message #529824 is a reply to message #528507] Tue, 27 April 2010 07:24 Go to previous messageGo to next message
Stefan Stern is currently offline Stefan Stern
Messages: 9
Registered: July 2009
Junior Member
Hi

Thanks for your reply. For testing purpose, I created two plugins, first
with RCP mailapp example wizard for RCP applications, second was a
bundle with a sample action. I configured the mailapp product to be
based on features, created a feature for the product and a feature for
the sample action. The product includes Eclipse Platform Feature, P2.UI
feature, the feature for the RCP mailapp and finally the feature for the
sample action.

Then I deployed the mailapp, could launch it, all fine. Now I created a
feature patch, which updates the sample action feature. I incremented
the version of the sample action bundle, altered the message box text,
deployed the feature patch in a new location, launched the mailapp and
selected "install new software". After pointing to the repo with the
feature patch, the update completes, mailapp restarts and - guess what -
the new bundle was installed.

Phew.

I will check again with the feature patch for my own product or - the
other way round - try to corrupt the mailapp example.

Both repository content.xml look similiar, means have adequate IUs with
proper version ranges and "from" and "to" in the fitting configuration.

I will keep you updated.

Thanks and kind regards,
Stefan Stern
Re: P2 and Feature Patch [message #530941 is a reply to message #529824] Mon, 03 May 2010 02:22 Go to previous message
Stefan Stern is currently offline Stefan Stern
Messages: 9
Registered: July 2009
Junior Member
Hi again

I re-installed our product from scratch, then installed the feature
patch, and it worked right away. So I started my already installed
produect, where the installation of the feature patch failed, with
"-initialize". Then I tried the installation again. This time the bundle
installed properly, everything is ok.

I have no idea what went wrong, causing the feature patch to install
without the new bundle. But cleaning up the caches has solved the issue.

Thanks and kind regards,
Stefan
Previous Topic:Link to TOC pages in a TOC page
Next Topic:Absolute path of file in bundle classpath
Goto Forum:
  


Current Time: Fri Aug 01 00:02:40 EDT 2014

Powered by FUDForum. Page generated in 0.10674 seconds