Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340284 - Custom p2 touchpoint actions broken when update site contains signed bundle JAR files
Summary: Custom p2 touchpoint actions broken when update site contains signed bundle J...
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 295712 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-17 05:24 EDT by Simon Rigg CLA
Modified: 2019-10-24 15:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Rigg CLA 2011-03-17 05:24:59 EDT
Build Identifier: M20110210-1200

Let's say you have a plugin which contributes two custom p2 touchpoint actions
via the "org.eclipse.equinox.p2.engine.actions" extension point. In the
plugin's META-INF directory there is a p2.inf file which exports the actions:

provides.0.namespace=org.eclipse.equinox.p2.engine.actions
provides.0.name=some.installAction
provides.0.version=1.0
provides.1.namespace=org.eclipse.equinox.p2.engine.actions
provides.1.name=some.uninstallAction
provides.1.version=1.0

Now let's say you have a feature which contains this plugin in its list of
plugins. The feature, in its root directory, also contains a p2.inf file to
import and use the actions:

metaRequirements.0.namespace=org.eclipse.equinox.p2.engine.actions
metaRequirements.0.name=some.installAction
metaRequirements.0.range=1.0
metaRequirements.1.namespace=org.eclipse.equinox.p2.engine.actions
metaRequirements.1.name=some.uninstallAction
metaRequirements.1.range=1.0
instructions.install=some.installAction();
instructions.uninstall=some.uninstallAction();

NOTE: the instructions.<phase>.import directive is not used as the actions are
referenced by fully-qualified names.

Basically, you just want to add support for custom install and uninstall
actions to your feature for use in the p2 install/update dialog.

After creating the update site for this feature and plugin the following can be
observed:

1. With both custom p2 touchpoint actions present and all JAR files UNsigned,
the installation occurs in one step and the some.installAction is invoked. When
uninstalling the feature, the some.uninstallAction is invoked as expected.
FINE.

2. With either (but NOT both) of the custom p2 touchpoint actions present and
all JAR files SIGNED, the installation occurs in one step and the
some.installAction is invoked (if present). When uninstalling the feature, the
some.uninstallAction is invoked (if present) as expected. FINE.

3. PROBLEM: If BOTH the custom p2 touchpoint actions are present and all JAR
files SIGNED, the installation occurs in multiple steps. First, Eclipse
installs the plugin with the custom actions then prompts to restart but
some.installAction is NOT invoked at this time. After restarting Eclipse,
install the feature again from the update site. Now the some.installAction is
successfully invoked.

The intermediate restart of Eclipse and repeated installation of the feature
should not be necessary just because you have multiple custom p2 touchpoint
actions and signed bundle JAR files in your update site.

Reproducible: Always

Steps to Reproduce:
1. Create a default, basic feature and plugin project as described.
2. Create and export an update site for the feature (which includes the
plugin).
3. Sign both the feature and plugin JAR files in the update site with a
self-signed keystore. If necessary, use
"org.eclipse.equinox.p2.publisher.UpdateSitePublisher" application to
re-generate the artifacts.jar and content.jar files (but this didn't seem to
make a difference for me - I thought it may have been wrong file size or MD5
after JAR signing, but it is not the case).
4. In a fresh Eclipse installation, install the feature from the update site.
Note that the custom action is not invoked.
5. Restart Eclipse when prompted, install the feature from the update site once
more in the same Eclipse installation and note that now the custom action is
invoked.
Comment 1 Pascal Rapicault CLA 2011-06-11 17:18:18 EDT
Sorry that this fell through the cracks... Could you please provide the sample update site to ease the investigation?
Comment 2 Pascal Rapicault CLA 2011-06-12 21:18:46 EDT
*** Bug 295712 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2019-10-24 15:51:41 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.